-
Notifications
You must be signed in to change notification settings - Fork 3
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
KLogging + Log4j: Always getting JVMLogger.kt:21
as filename and line number
#5
Comments
Funny, sl4j asks "do not make any wrappers" Just tried you format. Works for me. (Have no idea why, actually )) ) @Zomis How do you add logger in class? And how do you call logger? |
Example code:
Gradle dependencies:
log4j.properties:
Output:
|
@Lewik Can you share more about your setup? What logging implementation do you use? Log4j 1.2.17 ? Log4j2? Logback? Commons? Anything else? It would be very helpful for me to see something else than |
@Zomis I am late a bit. Do you have any updates? |
@Lewik No updates here, I've been waiting for a response from you |
@Zomis class MyClass: WithLogging {
override val logger: KLogger
get() = KLoggers.logger(this)
// code
} |
@BorzdeG No it does not, all my logging message still looks like they are being logged from |
I am using:
log4j.appender.stdout.layout.ConversionPattern=[%d{ISO8601}] %5p %10c{1} [%10t] (%22F:%3L) - %m%n
Having the filename and line number available is very helpful for me when developing/debugging.
When using Log4j without KLogging, I get the file name and line number of my code, which varies for each place I call
logger.info...
.When I use Log4j with KLogging, I always get the same filename and line number,
JVMLogger.kt:21
because JVMLogger is the one making the call to the Slf4j API.Can this be handled in KLogging somehow or can I do something about it in my code?
The text was updated successfully, but these errors were encountered: