logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Faine, Mark R. (MSFC-NNM04AA02C)[SAIC]" <mark.fa...@nasa.gov>
Subject RE: Pretty Layout of logging by class & method
Date Fri, 31 Aug 2007 15:45:11 GMT
The question really just goes to layout though I suppose logger.log will
be called in various locations in nearly every method but also
specifically at the start and end of each method.  My first thought was
a layout class that indented logger.log calls within methods but there
is the question of how to know the level of indention for each
logger.log call.  I also considered the XML layout and applying XSLT but
that seems far too involved a solution.

Here is another example that looks a little more accurate.  (only an
example, not based on real output)

08:50:49,661 DEBUG Class1:29     Inside Main Method Class1
08:50:50,663 DEBUG Class1:30     Calling Sub method Class1
08:50:51,663 DEBUG Class1:131      Inside Sub Method Class1
08:50:52,663 DEBUG Class:135         Some other debugging statement...
08:50:53,664 DEBUG Class1:138        Calling method in another class...
08:50:54,665 DEBUG   Class2:253      Inside  Method of Class2
08:50:55,666 DEBUG   Class2:300        Calling Sub method in Class2
08:50:56,667 DEBUG   Class2:340         Some other debugging
statement...
08:50:57,668 DEBUG   Class2:345        Success sub-method of Class2
08:50:58,669 DEBUG   Class2:346      Success method of Class2
08:50:59,663 DEBUG Class1:245      Success Sub Method of Class1
08:51:00,663 DEBUG Class1:245    Success Main Method of Class1


-----Original Message-----
From: Matthew Kemp [mailto:mattkemp@gmail.com] 
Sent: Friday, August 31, 2007 10:19 AM
To: Log4J Users List
Subject: Re: Pretty Layout of logging by class & method

Are you saying that you want one logger.log() call to print the entire
stack trace? Or do you want logger.log() calls exiting and entering each
method?

On 8/31/07, Faine, Mark R. (MSFC-NNM04AA02C)[SAIC] <mark.faine@nasa.gov>
wrote:
>
>
> I'd like for Log4J to print the log messages with some sort of 
> indentation, preferably by Class and Method
>
> Something like:
>
> Start Class1
>   Inside Main method...
>   Calling Sub method...
>     Inside Sub method...
>       Executing operations in sub method...
>     Sub Method success
>   Main Method success
> End Class1
> Start Class2
> ...
> End Class2
>
> Is this currently possible?
>
> Thanks,
> -Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message