logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cash, Jamie" <JC...@ifdsgroup.co.uk>
Subject RE: Custom Level
Date Thu, 23 Mar 2006 15:05:18 GMT
Note: The xml should have read <param name="Threshold" value="BUSINESS#BusinessLevel"/>
not <param name="Threshold" value="Business#BusinessLevel"/>



--- Original Message ---

I have created a custom level that works as far as logging is concerned, but is ignored when
set as a threshold.

The level is defined as follows:

public class BusinessLevel extends Level
{
  //Business Level Integer Values
  public static final int BUSINESS_INT = FATAL_INT + 10000;
  
  //Business Levels
  public static final Level BUSINESS = new BusinessLevel(BUSINESS_INT, "BUSINESS", SyslogAppender.LOG_LOCAL0);
  
  /**
   * Constructor
   * 
   * @param level
   * @param levelStr
   * @param syslogEquivalent
   */
  public BusinessLevel(int level, String levelStr, int syslogEquivalent)
  {
    super(level, levelStr, syslogEquivalent);
  }
}

When I set the threshold to fatal, both fatal and business errors are logged. This is correct.
But when I set the threshold to business, all levels are logged.

My appender config is as follows:

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
      <param name="Target" value="System.out"/>
			<param name="Threshold" value="Business#BusinessLevel"/>
      <layout class="org.apache.log4j.PatternLayout">
         <!-- The default pattern: Date Priority [Category] Message\n -->
         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
      </layout>
   </appender>

What am I doing wrong?

Any help would be much apprecieated.

Regards

Jamie

-----Original Message-----
From: log4j-user-help@logging.apache.org
[mailto:log4j-user-help@logging.apache.org]
Sent: 23 March 2006 11:43
To: Cash, Jamie
Subject: WELCOME to log4j-user@logging.apache.org


Hi! This is the ezmlm program. I'm managing the
log4j-user@logging.apache.org mailing list.

I'm working for my owner, who can be reached
at log4j-user-owner@logging.apache.org.

Acknowledgment: I have added the address

   JCash@ifdsgroup.co.uk

to the log4j-user mailing list.

Welcome to log4j-user@logging.apache.org!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.


--- Administrative commands for the log4j-user list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <log4j-user-subscribe@logging.apache.org>

To remove your address from the list, send a message to:
   <log4j-user-unsubscribe@logging.apache.org>

Send mail to the following for info and FAQ for this list:
   <log4j-user-info@logging.apache.org>
   <log4j-user-faq@logging.apache.org>

Similar addresses exist for the digest list:
   <log4j-user-digest-subscribe@logging.apache.org>
   <log4j-user-digest-unsubscribe@logging.apache.org>

To get messages 123 through 145 (a maximum of 100 per request), mail:
   <log4j-user-get.123_145@logging.apache.org>

To get an index with subject and author for messages 123-456 , mail:
   <log4j-user-index.123_456@logging.apache.org>

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   <log4j-user-thread.12345@logging.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<log4j-user-subscribe-john=host.domain@logging.apache.org>

To stop subscription for this address, mail:
<log4j-user-unsubscribe-john=host.domain@logging.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
log4j-user-owner@logging.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <JCash@ifdsgroup.co.uk>
Received: (qmail 55519 invoked by uid 99); 23 Mar 2006 11:42:33 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)
    by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2006 03:42:33 -0800
X-ASF-Spam-Status: No, hits=1.3 required=10.0
	tests=MISSING_SUBJECT
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [193.129.11.67] (HELO efmailgw02.ifdsgroup.co.uk) (193.129.11.67)
    by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2006 03:42:32 -0800
Received: from IFMAILSRV1.Mail.ifdsgroup.co.uk (unverified) by 
    efmailgw02.ifdsgroup.co.uk (Content Technologies SMTPRS 4.3.12) with 
    ESMTP id <T7733567305c0a8d04da44@efmailgw02.ifdsgroup.co.uk> for 
    <log4j-user-sc.1143114106.dnpcpaclebcdeomjbdel-JCash=ifdsgroup.co.uk@logging.apache.org>
   ; Thu, 23 Mar 2006 11:46:51 +0000
content-class: urn:content-classes:message
Return-Receipt-To: "Cash, Jamie" <JCash@ifdsgroup.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Disposition-Notification-To: "Cash, Jamie" <JCash@ifdsgroup.co.uk>
X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0
Subject: 
Date: Thu, 23 Mar 2006 11:42:01 -0000
Message-ID: <5F1420E3DA005D42B1CAEC030E048CCB089E9B08@IFMAILSRV1.Mail.ifdsgroup.co.uk>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Index: AcZObsxqULVtEJl9SkySrhurDC/SmQ==
From: "Cash, Jamie" <JCash@ifdsgroup.co.uk>
To: <log4j-user-sc.1143114106.dnpcpaclebcdeomjbdel-JCash=ifdsgroup.co.uk@logging.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org



	__________________________
	I N T E R N A T I O N A L   F I N A N C I A L   D A T A  S E R V I C ES =
=20
	Jamie Cash
	Architecture Group
	IFDS House, St Nicholas Lane, Basildon, SS15 5FS
	Tel: 01268 44 3739
	email: jcash@ifdsgroup.co.uk
	_______________________________




INTERNATIONAL FINANCIAL DATA SERVICES (UK) LTD Tel: +44 1268 44 3000
********************** N O T I C E *********************************

This message and any attachments is intended only for the individual or com=
pany to which it is addressed and may contain
information which is privileged, confidential or prohibited from disclosure=
 or unauthorised use. If the recipient of this
transmission is not the intended recipient, or the employee or agent respon=
sible for delivering such materials to the
intended recipient, you are hereby notified that any use, any form of repro=
duction, dissemination, copying, disclosure,=20
modification, distribution and/or publication of this e-mail message or its=
 attachments other than by it's intended
recipient is strictly prohibited by the sender. If you have received it in =
error, please notify us immediately by=20
telephone on the number above and destroy the message and all copies in you=
r possession.

International Financial Data Services (UK) Ltd is authorised and regulated =
by the Financial Services Authority.

This footnote also confirms that this email message has been swept by MIMEs=
weeper for the presence of computer viruses.

**********************************************************************



INTERNATIONAL FINANCIAL DATA SERVICES (UK) LTD Tel: +44 1268 44 3000
********************** N O T I C E *********************************

This message and any attachments is intended only for the individual or company to which it
is addressed and may contain
information which is privileged, confidential or prohibited from disclosure or unauthorised
use. If the recipient of this
transmission is not the intended recipient, or the employee or agent responsible for delivering
such materials to the
intended recipient, you are hereby notified that any use, any form of reproduction, dissemination,
copying, disclosure, 
modification, distribution and/or publication of this e-mail message or its attachments other
than by it's intended
recipient is strictly prohibited by the sender. If you have received it in error, please notify
us immediately by 
telephone on the number above and destroy the message and all copies in your possession.

International Financial Data Services (UK) Ltd is authorised and regulated by the Financial
Services Authority.

This footnote also confirms that this email message has been swept by MIMEsweeper for the
presence of computer viruses.

**********************************************************************


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



INTERNATIONAL FINANCIAL DATA SERVICES (UK) LTD Tel: +44 1268 44 3000
********************** N O T I C E *********************************

This message and any attachments is intended only for the individual or company to which it
is addressed and may contain
information which is privileged, confidential or prohibited from disclosure or unauthorised
use. If the recipient of this
transmission is not the intended recipient, or the employee or agent responsible for delivering
such materials to the
intended recipient, you are hereby notified that any use, any form of reproduction, dissemination,
copying, disclosure, 
modification, distribution and/or publication of this e-mail message or its attachments other
than by it's intended
recipient is strictly prohibited by the sender. If you have received it in error, please notify
us immediately by 
telephone on the number above and destroy the message and all copies in your possession.

International Financial Data Services (UK) Ltd is authorised and regulated by the Financial
Services Authority.

This footnote also confirms that this email message has been swept by MIMEsweeper for the
presence of computer viruses.

**********************************************************************


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