Here i am again to tell you about my new learning that is : why should i use LOGGING in my project.
Does using any logging framework help in my project and what are its features and why is it famous and what is the need and in which case i should i use which feature.
First of all what is logging framework.Its like we make videos of our sweet memories in our life. In other word record some activity.
And to record the sweet memories(BUGS AND MANY MORE) in our development life logging framework is an option.
You would say : That said but whats wrong in using those console or alerts or println statements.
I say : Well, lets have a laugh on that. haha.
Lets explain now ,how is it a BOON:
1) The println statements will only be available to the console while The output from Log4j can go to the console,
but it can also go to an email server, a database table, a log file, or various other destinations.
2) There are various trace levels which you can set while using the logging like : TRACE, DEBUG, INFO, WARN, ERROR, and FATAL.
So when you set a level for logging logging will be done for all levels for all levels above it. So while development the level should be debug.
and while deployment the level should be INFO or higher.
3) You should always log decision making statements so that its easy for you to get the flow.
4) I think its cool to debugging, and troubleshooting with log4j and when some error occur in production and in case your luck is bad and its not reproducible in
development environment. So logging to the rescue here. This point has saved me a lot of times. I am sure you will agree on this.
5) And another point to debugging is when you have an error. Then you have to generate the whole test case which can take quite a lot of time on your local.
And if you will see the logging files for the testing server or the sandbox then it will be easy or atleast help you in finding the error.
6) It can also be used to trace application activity.
OR IS IT A CURSE :
Well, there is a some disadvantages also that is when you log you do lots of IO operations which in turn decreases the performance.
But i don't think it will decrease that much amount of performance. You can also go for logging to log things when the debug mode is enabled.
Don't use logging too much also as you might not be able to figure what happened actually by so many log files. SO take care on that.
Rest enjoy learning!
Last thing which i got from msdn.microsoft.com is The Logging Application Block formaters do not encrypt logging information, and trace listener destinations receive
logging information as clear text. This means that attackers that can access a trace listener destination can read the information.
Results :
So in all its a good thing with some disadvantages. But if try to cover the disadvantages its a BOOM.
Does using any logging framework help in my project and what are its features and why is it famous and what is the need and in which case i should i use which feature.
First of all what is logging framework.Its like we make videos of our sweet memories in our life. In other word record some activity.
And to record the sweet memories(BUGS AND MANY MORE) in our development life logging framework is an option.
You would say : That said but whats wrong in using those console or alerts or println statements.
I say : Well, lets have a laugh on that. haha.
Lets explain now ,how is it a BOON:
1) The println statements will only be available to the console while The output from Log4j can go to the console,
but it can also go to an email server, a database table, a log file, or various other destinations.
2) There are various trace levels which you can set while using the logging like : TRACE, DEBUG, INFO, WARN, ERROR, and FATAL.
So when you set a level for logging logging will be done for all levels for all levels above it. So while development the level should be debug.
and while deployment the level should be INFO or higher.
3) You should always log decision making statements so that its easy for you to get the flow.
4) I think its cool to debugging, and troubleshooting with log4j and when some error occur in production and in case your luck is bad and its not reproducible in
development environment. So logging to the rescue here. This point has saved me a lot of times. I am sure you will agree on this.
5) And another point to debugging is when you have an error. Then you have to generate the whole test case which can take quite a lot of time on your local.
And if you will see the logging files for the testing server or the sandbox then it will be easy or atleast help you in finding the error.
6) It can also be used to trace application activity.
OR IS IT A CURSE :
Well, there is a some disadvantages also that is when you log you do lots of IO operations which in turn decreases the performance.
But i don't think it will decrease that much amount of performance. You can also go for logging to log things when the debug mode is enabled.
Don't use logging too much also as you might not be able to figure what happened actually by so many log files. SO take care on that.
Rest enjoy learning!
Last thing which i got from msdn.microsoft.com is The Logging Application Block formaters do not encrypt logging information, and trace listener destinations receive
logging information as clear text. This means that attackers that can access a trace listener destination can read the information.
Results :
So in all its a good thing with some disadvantages. But if try to cover the disadvantages its a BOOM.
No comments:
Post a Comment