I am using Custom Logger for my project eg. class MyLogger. With that i am able to log the message correctly but Its not logging the Class & Method name correctly from where log initiated.
So I think may we need to specify MyLoggger in log4j.xml but I don't know where & how ?
All suggestions are appreciated. Thanks.
If you have a class MyClass:
That you want to custom format when logging, you can create a custom ObjectRenderer:
And link this up in the config like this, with a -element:
For a more complete example, take a look at http://www.java2s.com/Code/Java/Language-Basics/log4jAcompleteexample.htm