将log4j config转换为log4perl config

时间:2015-03-25 08:06:32

标签: perl logging log4j log4perl graylog2

如何将以下log4j配置转换为log4perl config

log4j.appender.graylog2                     = org.graylog2.log.GelfAppender
log4j.appender.graylog2.graylogHost         = somehostname
log4j.appender.graylog2.graylogPort         = XXXX # somePort
log4j.appender.graylog2.facility            = ${catalina.base}
log4j.appender.graylog2.layout              = org.apache.log4j.PatternLayout
log4j.appender.graylog2.extractStacktrace   = true
log4j.appender.graylog2.additionalFields    = {'customer': '${machine.customer}', 'stability': '${machine.stability}', 'appname': '${machine.appname}'}

我将其转换为

log4perl.appender.graylog2                  = Log::Log4perl::Appender::Socket
log4perl.appender.graylog2.PeerAddr         = somehostname
log4perl.appender.graylog2.PeerPort         = XXXX # somePort
log4perl.appender.graylog2.facility         = sub { $ENV{catalina.base } }
log4perl.appender.graylog2.layout           = Log::Log4perl::Layout::GELF
log4perl.appender.graylog2.extractStacktrace= true
log4perl.appender.graylog2.additionalFields = {'customer': 'sub { $ENV{machine.customer} }', 'stability': 'sub { $ENV{machine.stability} }', 'appname': 'sub { $ENV{ {machine.appname} }'}

这是对的吗?

0 个答案:

没有答案