Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable logstash-formatted JSON logging to the console #487

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

groldan
Copy link
Member

@groldan groldan commented Jun 17, 2024

To enable JSON logging, the applications must be run with the json-logs Spring profile.

The default configuration in the Docker images at /etc/geoserver/ include logback and rabbitmq config files for JSON logging:

  • logback-spring.xml defines a logstash compatible JSON console appender for spring boot apps. This default file is identical to the one included in the applications classpath already. In order to use this one, for example, may it require some tunning, the application must be run with -Dlogging.config=file:/etc/geoserver/logback-spring.xml, or any other location where the xml config file is placed.
  • A sample rabbitmq.conf file declaring console json logging output for rabbitmq. Must be mounted at /etc/rabbitmq/rabbitmq.conf, or use it as a guideline to enhance rabbitmq's configuration.

groldan added 3 commits June 16, 2024 01:53
New starter module to manage observability as a cross-cutting concern.

Start off by including logstash-logback-encoder.
@groldan groldan added the enhancement New feature or request label Jun 17, 2024
To enable JSON logging, the applications must be run with the
`json-logs` Spring profile.

The default configuration in the Docker images at `/etc/geoserver/`
include logback and rabbitmq config files for JSON logging:

* `logback-spring.xml` defines a logstash compatible JSON console
  appender for spring boot apps. This default file is identical to the
  one included in the applications classpath already. In order to use
  this one, for example, may it require some tunning, the application
  must be run with `-Dlogging.config=file:/etc/geoserver/logback-spring.xml`,
  or any other location where the xml config file is placed.
* A sample `rabbitmq.conf` file declaring console json logging output
  for rabbitmq. Must be mounted at `/etc/rabbitmq/rabbitmq.conf`, or use
  it as a guideline to enhance rabbitmq's configuration.
@groldan groldan force-pushed the observability/json_logging branch from c7dabbe to ee781d6 Compare June 17, 2024 01:08
@groldan groldan merged commit ca39550 into geoserver:main Jun 17, 2024
2 checks passed
groldan added a commit that referenced this pull request Jun 17, 2024
[backport 1.8.x] Enable logstash-formatted JSON logging to the console #487
@groldan groldan deleted the observability/json_logging branch June 17, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant