Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse-Neon & Slf4j b. Log4J(What's Best Practice For Old Project Using Log4J v. Slf4J?)
Eclipse-Neon & Slf4j b. Log4J [message #1770660] Tue, 15 August 2017 20:04
George Berish is currently offline George BerishFriend
Messages: 1
Registered: August 2017
Junior Member
Hi,

Q1: Can anyone tell me how to stop Eclipse-Neon from throwing up a LogFactor5 dialog box that scrolls for a second -- to fast to read --then dissappears?

Q2: Should old classes in my project be using something other than

import java.util.logging.Logger;
static final Logger logger = Logger.getLogger("SomeNameOrAnother");

If so, can anyone point me to the best place to begin learning what
I should be using instead of Log4J?

Here's why I ask.

I'm resurrecting and old Eclipse-Luna/WildFly-8 project. After a lot of catch up, e.g. Hornet being abandoned, I suddenly had SLF4J Warnings pop up. (I've pasted an excerpt below)

(It seems important to mention that Eclipse is executing main() on a Java Class that displays a client side Java Swing GUI allowing the user to communicate with the server side application and data base (WF-10). So:

--- On the client side it doesn't use any logging at all. (Which is why I guess I only received Warnings).

--- It's the server side classes that use Log4j (So I assume when I get to testing that side, I'll have Exceptions, not Warnings ... but that's for later)

For now (on client side:

I downloaded a current Apache Log4J package - apache-log4j-1.2.17

Added: slf4j-log4j12-1.8.0-alpha2.jar to build path.

That shifted Warnings to telling me I needed to properly configure Eclipse for Log4J.

Added: Log4J-1.2.17.jar to build path.

And as a stop gap I used
Run -> Run Configurations -> ClassPathadded -> User Entries -> Advanced
to add this folder to the build path (because it contained a log4J.properties file):
<apache-log4j-1.2.17>\examples\lf5\InitUsingLog4JProperties

(I know I'll need a better properties file later on the servier side, i.e. with the original Appenders that were tailored to the project ... but that that's also for later).

Now all Warnings are gone ... But

Whenever I run the project, Eclipse flashes a dialog box titled "LogFactor5".

And the box scrolls so rapidly it can't be read. Doesn't seem to hurt anything, but darn annoying, because it then disappears without doing anything.

Q2 is because even if I can stop that, I'm reading that Log4J was laid to rest.

So it looks like all I've done is patched up the project to keep using Log4J. Not a great practice. So I need to learn what SLF4J is, and how to use it instead of what seems to be just adding Log4j -> SLF4J translation.

Here's where the first Warnings took me:

"https: //www.slf4j.org /codes .html #StaticLoggerBinder

Failed to load class org.slf4j.impl.StaticLoggerBinder
This warning message is reported when the org.slf4j.impl.StaticLoggerBinder
class could not be loaded into memory. This happens when no appropriate
SLF4J binding could be found on the class path. Placing one (and only one)
of slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or
logback-classic.jar on the class path should solve the problem.

glb
Previous Topic:caps lock reversed
Next Topic:Android development for eclipse
Goto Forum:
  


Current Time: Tue Sep 24 13:45:51 GMT 2024

Powered by FUDForum. Page generated in 0.11645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top