rfoltyns / log4j2-elasticsearch

Log4j2 Elasticsearch Appender plugins
Apache License 2.0
174 stars 45 forks source link

Run elastic search appender in specific environment #86

Closed viratbiz closed 2 months ago

viratbiz commented 1 year ago

I am trying to run the elastic search appender in log4j2.xml only in production environment. Is there any way to do this?

rfoltyns commented 1 year ago

The most convenient way to do this is to configure it programmatically and enable it with a config flag.

Other than that, you can use Log4j2 Markers and log levels per environment to prevent logs from reaching the appender.

rfoltyns commented 1 year ago

@viratbiz Is there anything more I can address in the scope of this issue?