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

sflj jdk backend does not recognize class name #351

Closed
Frontrider opened this issue Aug 17, 2023 · 14 comments
Closed

sflj jdk backend does not recognize class name #351

Frontrider opened this issue Aug 17, 2023 · 14 comments

Comments

@Frontrider
Copy link

These are the log messages that I'm seeing. This is not the class that I was expecting, and there does not seem to be a way to change it.

Aug 17, 2023 9:51:14 PM io.github.oshai.kotlinlogging.KLogger$DefaultImpls atInfo$default

This is my dependency setup:

[versions]
sflj = "2.0.7"
kotlin-logging = "5.0.1"

[libraries]
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging-jvm", version.ref = "kotlin-logging" }
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "sflj" }
slf4j-jdk = { group = "org.slf4j", name = "slf4j-jdk14", version.ref = "sflj" }


[bundles]
logging = ["kotlin-logging","slf4j-jdk","slf4j"]

Most likely an issue with the JDK backend (so may be treated as invalid), but doing this can't provide a fix for it for some reason:
protected val logger = KotlinLogging.logger("name of logger")

Replaced the backend as a fix, but leaving it here as a reference.

@github-actions
Copy link

Thank you for reporting an issue. See the wiki for documentation and slack for questions.

@oshai
Copy link
Owner

oshai commented Aug 17, 2023

If you're using log4j it might be related to #332.
Anyway, if you can add a way to reproduce it I will be able to further investigate it.

@oshai
Copy link
Owner

oshai commented Aug 17, 2023

Btw - have you tried the latest version of kotlin-logging?

@Frontrider
Copy link
Author

Frontrider commented Aug 18, 2023

The way to reproduce it is to use the sfl4j-jdk backend. That reliably makes the problem emerge.
It is STRICTLY NOT a log4j backend, it uses the logger built into the JVM itself. Yes, that is a thing.

It might be the same issue.

@oshai
Copy link
Owner

oshai commented Aug 21, 2023

Can you please test it with version 5.1.0 (not 5.0.1)?

@Frontrider
Copy link
Author

Exactly the same.
[Wed Aug 23 19:31:42 CEST 2023] FINE: io.github.oshai.kotlinlogging.KLogger$DefaultImpls atDebug$default -

@oshai
Copy link
Owner

oshai commented Aug 23, 2023

I suspect what printed is location info and not logger name.
If you can provide a way to reproduce it (github repo) I will be able to further debug it.

@oshai
Copy link
Owner

oshai commented Nov 27, 2023

Most likely this is fixed in 5.1.1 as part of #332 .

@ennioVisco
Copy link

I still have this issue, any other?

@oshai
Copy link
Owner

oshai commented Feb 14, 2024

Can you please create a way to reproduce it?

@ennioVisco
Copy link

Can you please create a way to reproduce it?

I'm investigating because I just migrated from V3.

It could be I have to change something in slf4j.

@ennioVisco
Copy link

Can you please create a way to reproduce it?

I'm investigating because I just migrated from V3.

It could be I have to change something in slf4j.

Ok, that was the issue. It seems to work and the issue can be closed IMHO.

@oshai
Copy link
Owner

oshai commented Feb 14, 2024

Any more details on how it was fixed?

@ennioVisco
Copy link

Any more details on how it was fixed?

Tbh I just updated the other deps and cleaned the gradle caches. I wish I could tell you more, but it was just this for me :)

@oshai oshai closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants