Punit Jain wrote:hello,
i want to know what is logging in java.
i did a google search and i found lots of examples and codes, but still don't know
why to use logging?
when to use logging?
where to use logging?
Logging is, well, keeping a log of what is going on in application. Generally, all real life applications use log.
Why - Logging is basically used to give other user an idea of what is going on. e.g. an application might fail due to database is down etc. Now, if you log everything properly, you can understand to root cause by simply looking at the log. No need to open the code and start debugging
When - I would suggest that
you should always do logging. It always helps.
Where - You can choose a single file or multiple files (single file is easier to maintain).
You can use in built logging classes from Java, or some external utility like log4j etc.
I hope this helps.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)