Version 129 - Log4J2

137 views
Skip to first unread message

Maurizio Scarpis

unread,
Oct 27, 2022, 12:33:12 PM10/27/22
to SQL Workbench/J - DBMS independent SQL tool
Hi Thomas.
I installed new version.
Using it in a batch script (some insert and one wbexport) , this message appears:
ERROR StatusLogger Log4j2 could not find a logging implementation.
Please add log4j-core to the classpath.
Using SimpleLogger to log to the console...
Sorry for my ignorance about Java world but whar can I do to avoid this message ?
Or to set the logger ? Or simply hide the message ?
Thanks in advance
Maurizio 

Thomas Kellerer

unread,
Oct 27, 2022, 4:23:54 PM10/27/22
to sql-wo...@googlegroups.com
Log4J is not used unless you explicitly enabled it.

https://www.sql-workbench.eu/manual/settings.html#settings-log4j

If you don't use it, then just remove the configuration you have used to enable it.



Maurizio Scarpis schrieb am 27.10.2022 um 18:33:
> Hi Thomas.
> I installed new version.
> Using it in a batch script (some insert and one wbexport) , this message appears:
> /ERROR StatusLogger Log4j2 could not find a logging implementation.
> Please add log4j-core to the classpath.
> Using SimpleLogger to log to the console...
> /

Thomas Kellerer

unread,
Oct 27, 2022, 4:49:47 PM10/27/22
to sql-wo...@googlegroups.com
Ah, sorry this seems to be caused by the log4j-api.jar

You can just remove it from the ext directory, then the (warning) message should go away.

Regards
Thomas

Thomas Kellerer

unread,
Oct 29, 2022, 10:15:00 AM10/29/22
to SQL Workbench/J - DBMS independent SQL tool
My answer was a bit too hasty.

log4j-api.jar can't be deleted if you want to export to XLSX files. In that case it is needed because the POI libraries depend on it.

But you can avoid the warning on the command line if you start SQL Workbench using something like this:

    java -Dlog4j2.loggerContextFactory=org.apache.logging.log4j.simple.SimpleLoggerContextFactory -jar sqlworkbench.jar ...

You can also edit the batch files and add the -D parameter there (similar to the existing one
Thomas

Maurizio Scarpis

unread,
Nov 4, 2022, 5:04:23 AM11/4/22
to SQL Workbench/J - DBMS independent SQL tool
Hi Thomas.
Wonderful, it's all OK.
regards

Vitaly

unread,
Nov 17, 2022, 10:10:07 AM11/17/22
to SQL Workbench/J - DBMS independent SQL tool
Hi guys,
I've just come across the same problem.

I simply followed the suggestion from the error message - "Please add log4j-core to the classpath":

- downloaded log4j-core.jar from Maven Central,
- put it into the "ext" directory, next to the log4j-api.jar that was already there.

I've got the same version 2.17.2 (for  Workbench/J #129), that can be found in "META-INF/maven/org.apache.logging.log4j/log4j-api/pom.properties" inside log4j-api.jar.

I hope this helps someone.



Reply all
Reply to author
Forward
0 new messages