You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by GoodOne <mo...@gmail.com> on 2006/10/25 18:54:10 UTC

Logging "Cross Functional" categories in log4j

Hello All,
 This is my first posting so please bear with me.

I am using log4j and I would like to log based on technical and functional
partitions of the application so that I can filter logs later.
So technical partition would include EJB, Persistence, Servlet, BusinessTier
etc while functional partition could include
Accounts,Servicing,Plan,Infrastructure etc.

One idea is I could take a cartesian product as categories.
Any other ideas are welcome.

Thank you.
The Good one.

Re: Logging "Cross Functional" categories in log4j

Posted by Jacob Kjome <ho...@visi.com>.
You can get that sort of behavior using an MDC based filters on various
appenders.  There was a thread about a week ago or so that suggested allowing
for a custom class to be configured for a logger which would provide custom
criteria to determine if a level is enabled.  Of course, this is not reality at
this point.  Maybe Log4j-2.0.

Jake

Quoting GoodOne <mo...@gmail.com>:

> Thank you. But if I want to change the debug level in config file for all
> EJBs across all functional partitions, would it be possible if i use MDC
> values?
>
>
>
> On 10/25/06, James Stauffer <st...@gmail.com> wrote:
> >
> > One good option: use loggers based on the class name as normal and set
> > MDC values for the technical and functional partitions.
> >
> > On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> > > Hello All,
> > >  This is my first posting so please bear with me.
> > >
> > > I am using log4j and I would like to log based on technical and
> > functional
> > > partitions of the application so that I can filter logs later.
> > > So technical partition would include EJB, Persistence, Servlet,
> > BusinessTier
> > > etc while functional partition could include
> > > Accounts,Servicing,Plan,Infrastructure etc.
> > >
> > > One idea is I could take a cartesian product as categories.
> > > Any other ideas are welcome.
> > >
> > > Thank you.
> > > The Good one.
> > >
> > >
> >
> >
> > --
> > 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
> >
> >
>




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


Re: Logging "Cross Functional" categories in log4j

Posted by GoodOne <mo...@gmail.com>.
The scenario is like this:
I have a massive clustered application. Uses SOA with services,
webcomponents, EJBs, software agents distributed all over. They all log with
their CellName, ClusterName, NodeName, AppName, ServiceName, OtherNames in
their local space. Lets say we have a mechanism to consolidate all the log
files in a central location.
 Now I want to tweak the log generation based on WebComponents for Account
service independent of WebComponents for other services. Then I want to
change EJB Logging Level from Debug to Warn for all services across board.
Please dont ask me why I want to do that :-))) it is someone else's
requirements. We also want to have only 1 single log config file for all in
some network somewhere. Also I want to have UUID in the log for which I can
use MDC.
 How would I do it?
Constraints: I want to avoid using 2 loggers in all the classes. I want to
tweak around the log generation.
We can change log level based on Node,Cluster level. But I dont know how to
provide for a mechanism to change both technical and functional partitions
"independently".

On 10/25/06, James Stauffer <st...@gmail.com> wrote:
>
> Do you only want to change the debug leve for functional partitions or
> also technical partitions?
>
> On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> > Thank you. But if I want to change the debug level in config file for
> all
> > EJBs across all functional partitions, would it be possible if i use MDC
> > values?
> >
> >
> >
> > On 10/25/06, James Stauffer <st...@gmail.com> wrote:
> > >
> > > One good option: use loggers based on the class name as normal and set
> > > MDC values for the technical and functional partitions.
> > >
> > > On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> > > > Hello All,
> > > >  This is my first posting so please bear with me.
> > > >
> > > > I am using log4j and I would like to log based on technical and
> > > functional
> > > > partitions of the application so that I can filter logs later.
> > > > So technical partition would include EJB, Persistence, Servlet,
> > > BusinessTier
> > > > etc while functional partition could include
> > > > Accounts,Servicing,Plan,Infrastructure etc.
> > > >
> > > > One idea is I could take a cartesian product as categories.
> > > > Any other ideas are welcome.
> > > >
> > > > Thank you.
> > > > The Good one.
> > > >
> > > >
> > >
> > >
> > > --
> > > 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
> > >
> > >
> >
> >
>
>
> --
> 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
>
>

Re: Logging "Cross Functional" categories in log4j

Posted by James Stauffer <st...@gmail.com>.
Do you only want to change the debug leve for functional partitions or
also technical partitions?

On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> Thank you. But if I want to change the debug level in config file for all
> EJBs across all functional partitions, would it be possible if i use MDC
> values?
>
>
>
> On 10/25/06, James Stauffer <st...@gmail.com> wrote:
> >
> > One good option: use loggers based on the class name as normal and set
> > MDC values for the technical and functional partitions.
> >
> > On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> > > Hello All,
> > >  This is my first posting so please bear with me.
> > >
> > > I am using log4j and I would like to log based on technical and
> > functional
> > > partitions of the application so that I can filter logs later.
> > > So technical partition would include EJB, Persistence, Servlet,
> > BusinessTier
> > > etc while functional partition could include
> > > Accounts,Servicing,Plan,Infrastructure etc.
> > >
> > > One idea is I could take a cartesian product as categories.
> > > Any other ideas are welcome.
> > >
> > > Thank you.
> > > The Good one.
> > >
> > >
> >
> >
> > --
> > 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
> >
> >
>
>


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


Re: Logging "Cross Functional" categories in log4j

Posted by GoodOne <mo...@gmail.com>.
Thank you. But if I want to change the debug level in config file for all
EJBs across all functional partitions, would it be possible if i use MDC
values?



On 10/25/06, James Stauffer <st...@gmail.com> wrote:
>
> One good option: use loggers based on the class name as normal and set
> MDC values for the technical and functional partitions.
>
> On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> > Hello All,
> >  This is my first posting so please bear with me.
> >
> > I am using log4j and I would like to log based on technical and
> functional
> > partitions of the application so that I can filter logs later.
> > So technical partition would include EJB, Persistence, Servlet,
> BusinessTier
> > etc while functional partition could include
> > Accounts,Servicing,Plan,Infrastructure etc.
> >
> > One idea is I could take a cartesian product as categories.
> > Any other ideas are welcome.
> >
> > Thank you.
> > The Good one.
> >
> >
>
>
> --
> 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
>
>

Re: Logging "Cross Functional" categories in log4j

Posted by James Stauffer <st...@gmail.com>.
One good option: use loggers based on the class name as normal and set
MDC values for the technical and functional partitions.

On 10/25/06, GoodOne <mo...@gmail.com> wrote:
> Hello All,
>  This is my first posting so please bear with me.
>
> I am using log4j and I would like to log based on technical and functional
> partitions of the application so that I can filter logs later.
> So technical partition would include EJB, Persistence, Servlet, BusinessTier
> etc while functional partition could include
> Accounts,Servicing,Plan,Infrastructure etc.
>
> One idea is I could take a cartesian product as categories.
> Any other ideas are welcome.
>
> Thank you.
> The Good one.
>
>


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