The Atmos Java API implements logging via log4j. I really don't need logging. Does anyone know how to properly set up log4j, or to simply make it be quiet? I could tear it out of the API, but that seems a bit drastic. I checked the internet, but the log4j examples are exceptionally underwhelming.
My output:
C:\Data\atmoscli\bin>java -cp .;..\lib\* atmos ls /boot/ /boot/ log4j:WARN No appenders could be found for logger (com.emc.esu.api.rest.EsuRestApi). log4j:WARN Please initialize the log4j system properly. F /boot/boot.ini 4980cdb2a110105a04bf484d95d6a004c08036d5d40f
C:\Data\atmoscli\bin>
Jason Thornbrugh Principal Solutions Engineer GSC Demo Cloud
Actually, based on the messages you are seeing, log4j is probably not working because it could not load the configuration. You could safely ignore the WARN messages below unless you want the logging to work.
Yes, they can be safely ignored, but I want them to be supressed since I'm going to wrap this inside of an existing script and parse the text output of the Java command. FYI, the server that this will be run on is not a web server.
Ideally, I'd like to configure log4j programatically (not using an external configuration file). I just want the logging to go to the "bit bucket" with no warnings to the console.
Jason Thornbrugh Principal Solutions Engineer GSC Demo Cloud
My HTML was munged after posting. So much for WYSIWYG! Reposted as plaintext:
Thanks! Your suggestion worked perfectly. I also found a simple log4j sample online in case I want to enable logging later. In case anyone else has this question, here is the code that worked for me:
Disable log4j for com.emc.esu -----------------------------
aashishpatil
2 Intern
•
212 Posts
818
0
Posted June 7th, 2010 15:00
Hmm, ok -
See if something like this works -
OR
Check Logger, Level objects in the log4j JavaDocs.
http://logging.apache.org/log4j/1.2/apidocs