At which level logging should work in project..show me the ways to use logging concept. I am using role based access in project..

Recommended Answers

All 4 Replies

nothing to do with JSP, so you're not going to get an answer here.
and don't think you can boss people around, demanding answers in that tone. What happened to asking nicely?

How you can say logging is not related to JSP.... are you suggesting that logging can't be done in JSP? If so, then JSP designers seems to have missed something that is vital to all programming and capable of doing in any language of which I am aware.

Are you looking for logging "how to" or just general logging theory...

Typically you would want to set a variable to contain a logging level flag, then output the log messages based on the value of that flag...

Development & Debugging is greatly assisted by prudent logging, but such logging is not good for production... So as a minimum you would want to have a boolean flag to turn on/off debug logging.

Usually I set int values so 0=off, 1=standard, 2=warnings, 3=debug and 4=dump the heck out it...

Then throughout the code you check the log level and output the given messages "if" the message level is ">=" log level...

This helpful because you don't have backup and remove temporary log messages used to debug, you leave them all in, and then switch them on and off... if you later need to edit the code, the logging is still there, turn it on and it can walk you through the appliication....

This also helps when revisiting code after a few months or years, the robust logging of a properly running app. can help you remember exactly what it is doing and why...

And, before that guy comes back a complains about putting scriptlets in the JSP to do logging, the logging messages can be in a tag library or a bean, etc. and then called fromt he JSP page whereever they are relevant... so have a coke and smile and relax.

Peace,

use logging tag avilable from jakarta project which is based on log4j

Yes, and we have someone else who seems to think logging does apply to JSP... and winner is.... well the person who asked the questions originally then isn't it.. ;-)

Does sarcasm play well in type? ;-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.