LogstashSocketAppender include environment variable in output

Can you include the value of an environment variable in the json output when using the LogstashSocketAppender?

e.g. How would I include the value of an environment variable named FOO with every log message? Would it look something like this?

<appender name="SOCKET" class="net.logstash.logback.appender.LogstashSocketAppender">
  <provider class="net.logstash.logback.composite.loggingevent.LoggingEventPatternJsonProvider">
      "foo": "???"

p.s. Also posted the question at stackoverflow: https://stackoverflow.com/questions/48672503/logback-logstashsocketappender-include-environment-variable-in-output


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.