pbenito
asked on
How can use the built in logger utility to wirte log messages to a file?
Hi,
I am new to JDK 6 and want to have my log output go to a file AND the console. The below code works for me, but it only writes to the console. Any suggestions on how to make it write to a file AND console?
Thanks!
I am new to JDK 6 and want to have my log output go to a file AND the console. The below code works for me, but it only writes to the console. Any suggestions on how to make it write to a file AND console?
Thanks!
Logger l = Logger.getAnonymousLogger();
l.setLevel(Level.ALL);
String wsAddress = "http://localhost:8765/";
Endpoint.publish(wsAddress, new TestWebService());
l.log(Level.INFO,"The web service started. It can be located at " + wsAddress);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Understood....I'm having an issue importing the log4j jar into NetBeans....maye you can help with this issue too!
https://www.experts-exchange.com/questions/23321673/Why-can't-I-import-the-log4j-jar-library.html
Thanks!
https://www.experts-exchange.com/questions/23321673/Why-can't-I-import-the-log4j-jar-library.html
Thanks!
:-)
Bear in mind that most professional programs use log4j, not the JDK logging API