logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From debasis <acharya_archana2...@yahoo.co.in>
Subject Re: How can i built a java application using java debug class on
Date Fri, 25 Aug 2006 12:52:59 GMT

yes i need to track the method entry and exit abt need the o/p as 
-- VM Started --
> ====== main ======
> main -- HelloExample
> callerMethod -- HelloExample
> ====== main end ======
> -- The application exited --
>

this typr of o/p is possible using java Debug API. but i need to built this
sort of appplication using Log4j. i do not need o/p on the console and the
programme should be independent of Application server. is it possible and if
so how?

Thanks & Regards,



James Stauffer wrote:
> 
> I don't quite understand what you want to do.  One note is that you
> mignt want to use the log4j NDC class to track method entry and exit.
> 
> On 8/25/06, debasis <acharya_archana2000@yahoo.co.in> wrote:
>>
>> Hi,
>> As java API support the MethodEntryEvent, using which I can get the
>> automatic logging statements when the method is entered or exited as
>> HelloExample.main(with argument type).
>> Where HelloExample is the class name.
>> Main is the method entered with its argument types.
>> In some cases I have the o/p as
>> -- VM Started --
>> ====== main ======
>> main -- HelloExample
>> callerMethod -- HelloExample
>> ====== main end ======
>> -- The application exited --
>>
>> By using Log4J is there any possibility of getting these sort of o/p
>> along
>> with the loggers supported by Log4J. i mean to say can i built an java
>> application which supports the MethodEntryEvent and MethodExitEvent from
>> java API and also uses the Log4J debugging. I took an e.g. trace example,
>> which (in J2SE 1.4.x or 5.x) will be found in
>> $JAVA_HOME/demo/jpda/examples.jar and unpacking it by
>> jar -xvf $JAVA_HOME/demo/jpda/examples.jar i found the
>> com/sun/tools/example/trace/Trace.java and passed the class constructed
>> with
>> logger taken from Log4J. In this case the logging message is displayed on
>> the console. As per the requirement i need to transfer the whole o/p to
>> an
>> output file along with Log4J logger statements. in this case i should not
>> give any command in the cosule except compiling and executing the
>> programme.
>> the programm also should able to run without the main() as i need to
>> integrate Log4J with an application and the code must me application
>> server
>> independent. i need the output as i got using MethodEnteryEvent (shown as
>> above) in case of java application built using Log4J.
>>
>> Can any one help me in this regard. can any one give me some suggestion
>> or
>> any programme of this sort. All suggestions are welcomed.
>>
>> Thanks & Regards,
>> --
>> View this message in context:
>> http://www.nabble.com/How-can-i-built-a-java-application-using-java-debug-class-on-tf2162917.html#a5977690
>> Sent from the Log4j - Users forum at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
> 
> 
> -- 
> James Stauffer        http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-i-built-a-java-application-using-java-debug-class-on-tf2162917.html#a5982923
Sent from the Log4j - Users forum at Nabble.com.


---------------------------------------------------------------------
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