logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vajrakumar Dindalakopp <vajrakuma...@gmail.com>
Subject Re: Logging all the input parameters to all the methods in a webservice using DEBUG priority
Date Mon, 21 Jan 2013 08:06:05 GMT
Thanks for reply Butt,

Actually I am totally new to this log4j, So I need a simple example to
implement this.
I couldnt refer to your links because they are removed.
And here I need to attach it to Netbeans 7.3 , but here examples are with
eclipse.
Even the resources with netbeans are not working for my badness.

Actually log4E is a simple plugin for eclipse environment for log4j,
anything similar will be much more helpful.

On Sun, Jan 20, 2013 at 8:23 AM, Brett Randall <javabrett@gmail.com> wrote:

> Hi
>
> For this type of horizontal logging concern, an Aspect Oriented
> Programming (AOP) solution can be applied.  Choose an AOP library - I
> recommend AspectJ [1], then create pointcuts matching entry to all the
> methods/classes you are interested in.  You can capture the parameters
> and call the logging API from a simple aspect advising each method.
> You can choose between compile-time, post-compile-time (binary
> weaving) or runtime (load-time weaving) approaches to weave-in the
> logging advice.
>
> The advantage of an AOP approach is that you don't need to add any
> code to each method requiring log-on-entry (or return).  This also
> means you can easily remove any logging overhead at a later time.
>
> Take a look at the Perf4j [2] project if you are looking for examples
> of code which is advised to add logging statements - in this case it
> is capturing method-execution timings using around-advice.
>
> Best
> Brett
>
> [1] http://www.eclipse.org/aspectj/
> [2] http://perf4j.codehaus.org/
>
> On 20 January 2013 08:12, Vajrakumar Dindalakopp <vajrakumar.d@gmail.com>
> wrote:
> > Hello team,
> >
> > Usually this is a quite common requirement I guss to log all the input
> > parameters to a method to a log with DEBUG modifier so that it can be
> > controlled.
> >
> > I agree this we can achieve by writing logs using log4j with DEBUG
> priority
> > at the starting of all methods .
> > My question is :
> > " Is there a common way using which no need to write tgis line,
> > automatically when new method created it has this line. And you can
> control
> > wether to print or not these input parameters."
> >
> > A code sample may be really helpfull.
> >
> > Something like Log4E plugin for eclipse I need to do in Netbeans.
> >
> > Thanking you in advance.
> > --
> > With Regards,
> > **
> > *Vajrakumar N. D*
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
With Regards,
**
*Vajrakumar N. D*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message