Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 6717 invoked from network); 20 Feb 2008 22:07:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 22:07:08 -0000 Received: (qmail 10559 invoked by uid 500); 20 Feb 2008 22:07:02 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 10532 invoked by uid 500); 20 Feb 2008 22:07:02 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 10521 invoked by uid 99); 20 Feb 2008 22:07:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 14:07:02 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thornley.david@gmail.com designates 209.85.198.191 as permitted sender) Received: from [209.85.198.191] (HELO rv-out-0910.google.com) (209.85.198.191) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 22:06:29 +0000 Received: by rv-out-0910.google.com with SMTP id c27so2306436rvf.10 for ; Wed, 20 Feb 2008 14:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=ysAwsdswY+2wp6lmHzJ4YJhbY5+UrKVkKqA+DYDWYcE=; b=uFwqm8ONJ5QGycTNuQZM3MkPzy853YOEi9Ss3GpD+zrHNQUk8kBdYG9kjYu9HUu1VqC2PYmRspD9IJpwdg4StmtpTEN20FjxbaMJLZvOQnAT9AXxrR1gl7GU14RyG41cHO4dX2bYN3mRikrlKkXtah/VnYE2LLScrcFsa0n9c0E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=GS9znkAsP3ji9p8T5pHmQ5tvSHodynRsXMhf4g9Gp2RJIiFVt4DAOjox0gkyjsFkjxhwtOTQVZcdgEk+IjWnlKQzkXJQJ9Q/OVE1i3qW49upNhf+vjnH1WzpGsp7jEq2JMjj7yDuDV7FiOv9WEvtGhemBXDWU5PkGrO+QfzcmHA= Received: by 10.141.50.17 with SMTP id c17mr6124667rvk.81.1203545197660; Wed, 20 Feb 2008 14:06:37 -0800 (PST) Received: by 10.141.77.7 with HTTP; Wed, 20 Feb 2008 14:06:37 -0800 (PST) Message-ID: <6ffad6400802201406h4cb22cc7t8de30719682064ed@mail.gmail.com> Date: Thu, 21 Feb 2008 09:06:37 +1100 From: "David Thornley" To: log4net-user@logging.apache.org Subject: Properties at the Logger level. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_225_15246707.1203545197648" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_225_15246707.1203545197648 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Is it possible to have properties associated at the logger level. I noticed they are available in the repository but not implemented in LoggingEvent.CreateCompositeProperties(). Basically, I have a windows service that has several listening sockets (implemented with asynchronous callbacks). I would like to track and log session activity on the server for each of these listening sockets with log4net. My understanding is that the ThreadContext scope will not allow me to track sessions in my case. The reason being that async callbacks are invoked on whatever thread the pool decides. So there is no threadcontext=session affinity. What I am aiming to do is add a new Logger for each session, and then set a group of properties relevant to that session for logging. The logger hierarchy would look like this: - Name.ServerA.[0x1234] Name.ServerA.[0x1111] Name.ServerB.[0x5679] Name.ServerB.[0x2222] So when I get a new logger for the session, I would like to be able to assign properties to that logger. Is this possible in log4net, after looking at the code it doesn't look that way? Would it be a major change to add properties at the logger level, and is there another way of achieving this that I haven't considered. Thanks in advance. Regards, David. ------=_Part_225_15246707.1203545197648 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Is it possible to have properties associated at the logger level. I noticed they are available in the repository but not implemented in LoggingEvent.CreateCompositeProperties().

Basically, I have a windows service that has several listening sockets (implemented with asynchronous callbacks). I would like to track and log session activity on the server for each of these listening sockets with log4net.

My understanding is that the ThreadContext scope will not allow me to track sessions in my case. The reason being that async callbacks are invoked on whatever thread the pool decides. So there is no threadcontext=session affinity.

What I am aiming to do is add a new Logger for each session, and then set a group of properties relevant to that session for logging. The logger hierarchy would look like this: -

Name.ServerA.[0x1234]
Name.ServerA.[0x1111]
Name.ServerB.[0x5679]
Name.ServerB.[0x2222]

So when I get a new logger for the session, I would like to be able to assign properties to that logger.

Is this possible in log4net, after looking at the code it doesn't look that way?

Would it be a major change to add properties at the logger level, and is there another way of achieving this that I haven't considered.

Thanks in advance.

Regards,

David.

------=_Part_225_15246707.1203545197648--