-
-
Save asraful/d54bffc7c2d87ded5834d38c624c47a4 to your computer and use it in GitHub Desktop.
logback - print filename and line number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<appender name="FILE" class="ch.qos.logback.core.FileAppender"> | |
<file>myapp.log</file> | |
<encoder><pattern>%logger{35} - [%F:%L] - %msg%n</pattern></encoder> | |
</appender> | |
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender"> | |
<appender-ref ref="FILE" /> | |
<!-- add the following line --> | |
<includeCallerData>true</includeCallerData> | |
</appender> | |
<root level="DEBUG"><appender-ref ref="ASYNC" /></root> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment