From e2d29778705cf32d4628ecd81e6fcce73bb5348b Mon Sep 17 00:00:00 2001 From: Suyog Rao Date: Tue, 13 Sep 2016 13:59:45 -0700 Subject: [PATCH] add package specific log4j2 logging props Fixes #5894 Fixes #5903 --- pkg/log4j2.properties | 26 ++++++++++++++++++++++++++ rakelib/artifacts.rake | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 pkg/log4j2.properties diff --git a/pkg/log4j2.properties b/pkg/log4j2.properties new file mode 100644 index 000000000..fa918832e --- /dev/null +++ b/pkg/log4j2.properties @@ -0,0 +1,26 @@ +status = error +name = LogstashPropertiesConfig + +appender.console.type = Console +appender.console.name = console +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %m%n +# JSON Logging +# appender.console.layout.type = JSONLayout +# appender.console.layout.compact = true +# appender.console.layout.eventEol = true + +appender.rolling.type = RollingFile +appender.rolling.name = rolling +appender.rolling.fileName = ${sys:ls.logs}/logstash.log +appender.rolling.layout.type = PatternLayout +appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %.10000m%n +appender.rolling.filePattern = ${sys:ls.logs}/logstash-%d{yyyy-MM-dd}.log +appender.rolling.policies.type = Policies +appender.rolling.policies.time.type = TimeBasedTriggeringPolicy +appender.rolling.policies.time.interval = 1 +appender.rolling.policies.time.modulate = true + +rootLogger.level = error +rootLogger.appenderRef.console.ref = console +rootLogger.appenderRef.rolling.ref = rolling diff --git a/rakelib/artifacts.rake b/rakelib/artifacts.rake index 3a071a0da..24ed1463b 100644 --- a/rakelib/artifacts.rake +++ b/rakelib/artifacts.rake @@ -309,8 +309,8 @@ namespace "artifact" do basedir = File.join(File.dirname(__FILE__), "..") - File.join(basedir, "pkg", "logrotate.conf").tap do |path| - dir.input("#{path}=/etc/logrotate.d/logstash") + File.join(basedir, "pkg", "log4j2.conf").tap do |path| + dir.input("#{path}=/etc/logstash") end # Create an empty /var/log/logstash/ directory in the package