![]() ![]() |
Custom Search
Home >> Miscellaneous
Log4j Example : Using various levels of logging using Apache Log4j Suppose there is a log file to be analyzed for certain issues while tracing activity is performed. This activity can be real difficult if one has to find/look for a pin from a box full of sand, type of situation. This may happen if number of tracing / logging lines of statements ranges from few hundred to thousand lines for a real big application with many classes being executed with an operation. So what do you think can be possible way to simplify this particular problem?? In my thinking if there could be some way to filter only those log statements, those are related to one particular class or component in hand. Yes, You are right!!! Apache Log4j has a provision for defining which class to be considered for logging and leaving rest of the classes not eligible for logging purpose. In this example I shall try to demonstrate this objective of configuring log4j.properties file in such a way so as to provide a filter kind of functionality and this should be done without any code change as far as the Java class files are concerned. So this is pretty configuration time setting up activity. In order to show a method execution flow, I have defined three dummy class files, such as ExampleController, ExampleService, ExampleDAO with some dummy kind of methods too.
References : Tags: TabHost and TabActivity Example on Android Platform Tags: ListView Example on Android Platform Tags: android sensors list Tags: android listview example Tags: android imageview example Tags: Android example download any file sourcecode Tags: android expandable list dynamically created example Tags: android expandable list example Tags: Android Gallery surfaceviews spinner Tags: Android example download any file sourcecode Tags: Android Layout Example Tags: Android Text To Speech Example Tags: DOJO Example Dialog Tags: DOJO Example Tree Widget Tags: different logger file log4j Tags: JDBC Transaction isolation Tags: event handling java code Tags: example quartz scheduler Tags: example tag library web application Tags: Flex Tags: index Tags: inmemory image creation java awt Tags: JSF Example Main Tags: JSF Example Tags CheckBoxes Tags: JSF Example Tags dataTable Tags: JSF Example Tags SelectBoxes Tags: JSF Example Tags Walkthrough Tags: JSF Example Validation Tags: JSF Resource Bundle Tags: log4j example 1 Tags: log4j example Tags: Miscellaneous Tags: Mule ESB File Transport Tags: Mule ESB JMS Transport Tags: stream download batch Tags: sychronized block wait notify Tags: thread wait notify example Tags: using apache commons log Tags: web load test Tags: Wizard Framework Idea Java DISCLAIMER : The content provided in this page is not warranted and/or guaranteed by techienjoy.com. techienjoy.com is not liable for any negative consequences that may result/arise from implementing directly/indirectly any information covered in these pages/articles/tutorials. All contents of this site is/are written and provided on an "AS IS" basis, without WARRANTIES or conditions of any kind, either express or implied, including, without limitation, merchantability, or fitness for a particular purpose. You are solely responsible for determining the appropriateness of using or refering this and assume any risks associated with this. In spite of all precautions taken to avoid any typo in these pages, there might be some issues like grammatical mistakes and typos being observed in these pages, techienjoy.com extends sincerest apologies to all our visitors for the same.
© Copyright 2010-2012, TECHIENJOY,
All Rights Reserved.
Privacy Policy Disclaimer & Terms & Conditions
![]() ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||