I'm making plugin for Minecraft - 'Paper' exactly. And it uses JDA for Discord bot function.
The problem is, Minecraft(Paper) uses log4j as its logging library. JDA uses slf4j as its logging library. I want JDA to use log4j so that error message of JDA would be shown in console as plugin's error message. (See EDIT2 for actual logs)
No System.out.println()
because Minecraft(Paper) will complain about using it.
No Logback because I think it is another logging library, thus it cannot work well with Minecraft(Paper)'s logging system (no JDA logs in Minecraft log etc.). I don't want to implement another logging library when there is already logging system provided by Minecraft, which is log4j.
JDA wiki only describes about Logback so I have to find my own way for making JDA with Minecraft's logging system, but it was no success.
For example:
// Something went wrong in JDA and shows stacktrace
[05:20:26] [Server thread/ERROR]: [MyPlugin] [JDA] 'JDA Error Message'
(prints stacktrace of the error)
// Show debug message of WebSocketClient (Since it is debug message, this can be turned off)
[05:20:26] [Server thread/DEBUG]: [MyPlugin] [JDA] WebSocketClient - Connected to WebSocket
// Show JDA message when JDA bot is loaded
[05:20:26] [Server thread/DEBUG]: [MyPlugin] [JDA] JDA - Finished Loading!
These all messages should be part of the Minecraft(Paper)'s logging system, not mimicing it. This means, it should use JavaPlugin#getLogger().info()
or something like this in somewhere of the code.
How to make JDA to be like this?
Just implementing log4j-slf4j18-impl
doesn't work. I think I should do something about JDA's logging stuff.
EDIT: Here is current build.gradle
file content. LINK
Currently, my plugin implements log4j-slf4j-impl
for JDA.