qos-ch / logback

The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
Other
2.98k stars 1.28k forks source link

A way to serialize a model: CLI, web, else #748

Open edudar opened 9 months ago

edudar commented 9 months ago

Unless I'm missing something obvious, there's no easy way to serialize the Logback model to scmo file.

One way to do that is to include <serializeModel file="..."> into XML config. When Logback runs such a configuration, it'll serialize itself into the given file. Two problems here. First, it's not very convenient to get a serialized model only when the app starts, especially when maintaining shared configuration, meaning there's no app to start to begin with. Second, the serialized model contains a model to serialize itself, so every time the app starts, it creates a new scmo file.

It would be so much better if there was a CLI tool that users could point to XML files and get SCMO files as an output.