How to add customized Appender


(sheling zhang) #1

Hi,

I have a customized ExternallyRolledFileAppender called MyExternallyFileAppender, which will is located in different folder than elasticsearch class path since it is shared by multiple products. for example my appender: com.a.b.java_utils.MyExternallyFileAppender is located in /opt/myproduct/share/myexternallyfileappender.jar
now I want to use this appender in my logging.yml file, what should change in logging.yml?

I am also trying to find equivalence of following log4j properties in logging.yml of elasticsearch

log4j.appender.MyExternallyFileAppender=com.a.b.java_utils.MyExternallyFileAppender
log4j.appender.MyExternallyFileAppender.File=/opt/myapp/var/elasticsearch.log
log4j.appender.MyExternallyFileAppender.Port=1234
log4j.appender.MyExternallyFileAppender.layout=org.apache.log4j.PatternLayout

Thank for your help

Jack Zhang


(system) #2