Support prefix option for Logback integration
See original GitHub issueSupport prefix option <exportPrefix> for Logback integration to specify the prefix of exported MDC properties.
For example, if this xml is loaded
<appender name="RCEA" class="com.linecorp.armeria.common.logback.RequestContextExportingAppender">
<!-- specify the prefix of exported MDC properties -->
<exportPrefix>armeria</exportPrefix>
<export>req.*</export>
<export>res.*</export>
...
</appender>
then RequestContextExportingAppender exports armeria.req.path, armeria.req.service_name, armeria.res.status_code, etc.
Issue Analytics
- State:
- Created 3 years ago
- Comments:29 (20 by maintainers)
Top Results From Across the Web
A Guide To Logback - Baeldung
Logback supports the creation of custom classes for formatting messages, as well as robust configuration options for the existing ones.
Read more >Logback-access - QOS.ch
The logback-access module, part of the standard logback distribution, integrates with Servlet containers such as Jetty or Tomcat to provide rich and ...
Read more >How to configure logback to append special prefix for each ...
I have a class that takes string parameter in its constructor which represents it. And i want to append this string as prefix...
Read more >Solving Your Logging Problems with Logback - Stackify
Logback is definitely a great choice when used to its full potential. ... such as slf4j support; logback-access – provides integration with ...
Read more >83.1 Configure Logback for Logging - Spring
To configure the more fine-grained settings of a logging system, you need to use the native configuration format supported by the LoggingSystem in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Another thing to consider is that we might add support for other logging frameworks in the future, e.g. log4j2. We might want to keep the same set of XML tags if possible for consistent user experience.
How about
<exportGroup>?One thing to think about is whether we need to allow an empty prefix, i.e.
<prefix />. It looks somewhat confusing, so it’s probably better throwing an exception? Users can still achieve what they want with proper grouping of exports:We might also want to an additional tag that excludes some exports:
Makes sense?