Hi!!
I’m working in a java application and I want to configure graylog host and port in an external configuration file.
This is the graylog appender in my log4j.properties file:
log4j.appender.graylog2=org.graylog2.log.GelfAppender
log4j.appender.graylog2.graylogHost=172.21.242.209
log4j.appender.graylog2.graylogPort=12201
log4j.appender.graylog2.originHost=david-localhost
log4j.appender.graylog2.facility=gelf-java
log4j.appender.graylog2.layout=org.apache.log4j.PatternLayout
log4j.appender.graylog2.extractStacktrace=true
log4j.appender.graylog2.addExtendedInformation=true
log4j.appender.graylog2.Threshold=ERROR
log4j.appender.graylog2.additionalFields={‘aplicacion’: ‘REPRESENTA’}
I would like to configure .graylogHost and .graylogPort as a properties in an external properties file. Can I do it? and then, how can I? How can I refer from my log4j.properties file to the propeties of this external file?
I’m using gelfj 1.1.15 and log4j 1.2.15.
Thanks a lot!!