Hi, I'm new to advanced programming and I would like to get more info about log4j. I mean info about Where I can get tutorial of it? How it's useful for us? In what way it is useful? where can we use this in programming? Kindly give detailed information. Regards, Naren.
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Originally posted by Naren Chivukula: Hi, I'm new to advanced programming and I would like to get more info about log4j. I mean info about Where I can get tutorial of it? How it's useful for us? In what way it is useful? where can we use this in programming? Kindly give detailed information. Regards, Naren.
Hello, Now I understand what is log4j and it's purpose. But, I do want to know the application of it with our conventional java program. How I get simple examples where log4j is used in our java program. I BADLY NEED THESE EXAMPLES. Kindly oblige me. Regards, Narendranath.
Originally posted by Naren Chivukula: I BADLY NEED THESE EXAMPLES.
Easy there, big fella. There's plenty of examples in the documentation (you did read the documentation Sadanand linked to, right?). You just use a log statement where you would otherwise use a System.out.println() for debug purposes. log4j gives you two big benefits over System.out.println(): 1. it is easy to send the logging info to files, servers, database or whatnot, depending on how you want to store/search your log information. 2. you don't have to remove the statements when you deploy your application. You use the log level (i.e. DEBUG, INFO, WARN, ERROR and FATAL), to control the level of output. You can set the log level to any of the 5 and the specified log level and every one above it will get printed out (i.e. set the log level to WARN and WARN, ERROR and FATAL get printed out). Obviously you should have a lot more DEBUG statements (i.e. whenever your user presses a button) than ERROR (i.e. whenever an exception occurs). There really isn't much more to it. . .
Thanks alot Joe. Finally I'm satisfied with your reply. Thanks Sadanand. May I know where which chat rooms are intended for programming languages? I'd like to get solutions right at the moment I pose. Regards, Naren.