mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
cassandra: add option to configure logging
As cassandra start script hardcodes the location of logback configuration to `CASSANDRA_CONF_DIR/logback.xml` there is no way to pass an alternate file via `$JVM_OPTS` for example. Also, without logback configuration DEBUG level is used which is not necessary for standard usage. With this commit a default logback configuration is set with log level INFO. Configuration borrowed from: https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configLoggingLevels.html
This commit is contained in:
parent
296b333709
commit
691932bba6
1 changed files with 22 additions and 0 deletions
|
@ -34,11 +34,13 @@ let
|
||||||
{ name = "cassandra-etc";
|
{ name = "cassandra-etc";
|
||||||
cassandraYaml = builtins.toJSON cassandraConfigWithAddresses;
|
cassandraYaml = builtins.toJSON cassandraConfigWithAddresses;
|
||||||
cassandraEnvPkg = "${cfg.package}/conf/cassandra-env.sh";
|
cassandraEnvPkg = "${cfg.package}/conf/cassandra-env.sh";
|
||||||
|
cassandraLogbackConfig = pkgs.writeText "logback.xml" cfg.logbackConfig;
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
|
|
||||||
echo "$cassandraYaml" > "$out/cassandra.yaml"
|
echo "$cassandraYaml" > "$out/cassandra.yaml"
|
||||||
ln -s "$cassandraEnvPkg" "$out/cassandra-env.sh"
|
ln -s "$cassandraEnvPkg" "$out/cassandra-env.sh"
|
||||||
|
ln -s "$cassandraLogbackConfig" "$out/logback.xml"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
@ -139,7 +141,27 @@ in {
|
||||||
correspond to a single address, IP aliasing is not supported.
|
correspond to a single address, IP aliasing is not supported.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
logbackConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = ''
|
||||||
|
<configuration scan="false">
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%-5level %date{HH:mm:ss,SSS} %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<logger name="com.thinkaurelius.thrift" level="ERROR"/>
|
||||||
|
</configuration>
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
XML logback configuration for cassandra
|
||||||
|
'';
|
||||||
|
};
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {};
|
default = {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue