add package specific log4j2 logging props

Fixes #5894

Fixes #5903
This commit is contained in:
Suyog Rao 2016-09-13 13:59:45 -07:00
parent 224bc36a27
commit e2d2977870
2 changed files with 28 additions and 2 deletions

26
pkg/log4j2.properties Normal file
View file

@ -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

View file

@ -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