Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 40045200AF5 for ; Thu, 2 Jun 2016 09:56:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3F6B9160A22; Thu, 2 Jun 2016 07:56:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5E157160A00 for ; Thu, 2 Jun 2016 09:56:00 +0200 (CEST) Received: (qmail 68787 invoked by uid 500); 2 Jun 2016 07:55:59 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 68768 invoked by uid 99); 2 Jun 2016 07:55:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2016 07:55:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 4C1A52C1F5D for ; Thu, 2 Jun 2016 07:55:59 +0000 (UTC) Date: Thu, 2 Jun 2016 07:55:59 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LOG4J2-1401) Support changing the log level for all messages related to some domain object MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 02 Jun 2016 07:56:01 -0000 [ https://issues.apache.org/jira/browse/LOG4J2-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Remko Popma updated LOG4J2-1401: -------------------------------- Description: During system operations, it is commonly desirable to temporarily make logging for a certain domain object more verbose. For example, all log messages related to processing a certain order, or for a certain user, or for a certain product. In addition to manually increasing/decreasing verbosity, it would be nice if we can restore the original verbosity if some condition no longer holds. For example, log at some verbose level * for some period of time (5 minutes) * for some fixed number of events (10,000 log messages) * any other user-specified condition *Problem 1: Log Event "Tagging"* How to efficiently "tag" log messages to select only _some_ log events to be output at a more verbose level but don't show _all_ log events? Current methods available for "tagging" a log event are: * *Markers*: String-based, name attribute only (no key-value), hierarchical (may have parents). Current implementation caches all Markers forever, with an option to clear the whole cache. Unclear how to use this mechanism to tag a log event with things like order ID, user ID and/or product ID. ** Update: one way to address these issues is to create a KeyValueMarker implementation of the Marker interface. A single instance could contain multiple tags (key-value pairs of arbitrary type). Instances cannot be cached by name in the MarkerManager, but instead I imagine we can use a pool of KeyValueMarkers to reuse (so we would need to call release() or something when the log event is fully processed). * *ThreadContext map*: the content of this map is merged into a properties map for each Log Event. The drawback of the ThreadContext API is that values must be Strings. We would like the ability to specify arbitrary Object values, or even primitive values. We can also take this opportunity to provide a garbage-free version of the ThreadContext (LOG4J2-1349) and the LogEvent properties map. * *Direct user access to the LogEvent properties map*. LOG4J2-1010 suggests changing the Logger API to accomplish this, but there may be alternatives (needs more thought). Similar to the above, ideally we would like the ability to specify arbitrary Object values, or even primitive values, not just Strings. * Other possibilities are *a new MessageFactory or a new LogEventFactory*. These would require invasive changes in the Log4j design across the board. It is not clear what the interfaces would look like for both upstream and downstream components. Improving the other mechanisms seems a better option. *Problem 2: Dynamic filtering* * What mechanism to use for increasing verbosity of events matching some condition? Global filters (on LogEvent properties or markers) may be a good candidate. * How can operators enable/disable this on the fly? * How can we provide convenience features for automatically reverting to the previous level of verbosity when some condition is met (e.g. after 10,000 events or after 5 minutes etc) was: During system operations, it is commonly desirable to temporarily make logging for a certain domain object more verbose. For example, all log messages related to processing a certain order, or for a certain user, or for a certain product. In addition to manually increasing/decreasing verbosity, it would be nice if we can restore the original verbosity if some condition no longer holds. For example, log at some verbose level * for some period of time (5 minutes) * for some fixed number of events (10,000 log messages) * any other user-specified condition *Problem 1: Log Event "Tagging"* How to efficiently "tag" log messages to select only _some_ log events to be output at a more verbose level but don't show _all_ log events? Current methods available for "tagging" a log event are: * *Markers*: String-based, name attribute only (no key-value), hierarchical (may have parents). Current implementation caches all Markers forever, with an option to clear the whole cache. Unclear how to use this mechanism to tag a log event with things like order ID, user ID and/or product ID. * *ThreadContext map*: the content of this map is merged into a properties map for each Log Event. This may be a good place to start since values can be replaced and/or cleared so we don't use up increasingly more memory. The drawback of the ThreadContext API is that values must be Strings. We would like the ability to specify arbitrary Object values, or even primitive values. We can also take this opportunity to provide a garbage-free version of the ThreadContext (LOG4J2-1349) and the LogEvent properties map. * *Direct user access to the LogEvent properties map*. LOG4J2-1010 suggests changing the Logger API to accomplish this, but there may be alternatives (needs more thought). Similar to the above, ideally we would like the ability to specify arbitrary Object values, or even primitive values, not just Strings. * Other possibilities are *a new MessageFactory or a new LogEventFactory*. These would require invasive changes in the Log4j design across the board. It is not clear what the interfaces would look like for both upstream and downstream components. Improving the other mechanisms seems *Problem 2: Dynamic filtering* * What mechanism to use for increasing verbosity of events matching some condition? Global filters (on LogEvent properties or markers) may be a good candidate. * How can operators enable/disable this on the fly? * How can we provide convenience features for automatically reverting to the previous level of verbosity when some condition is met (e.g. after 10,000 events or after 5 minutes etc) > Support changing the log level for all messages related to some domain object > ----------------------------------------------------------------------------- > > Key: LOG4J2-1401 > URL: https://issues.apache.org/jira/browse/LOG4J2-1401 > Project: Log4j 2 > Issue Type: New Feature > Components: Core, Filters > Affects Versions: 2.6 > Reporter: Remko Popma > > During system operations, it is commonly desirable to temporarily make logging for a certain domain object more verbose. For example, all log messages related to processing a certain order, or for a certain user, or for a certain product. > In addition to manually increasing/decreasing verbosity, it would be nice if we can restore the original verbosity if some condition no longer holds. For example, log at some verbose level > * for some period of time (5 minutes) > * for some fixed number of events (10,000 log messages) > * any other user-specified condition > *Problem 1: Log Event "Tagging"* > How to efficiently "tag" log messages to select only _some_ log events to be output at a more verbose level but don't show _all_ log events? Current methods available for "tagging" a log event are: > * *Markers*: String-based, name attribute only (no key-value), hierarchical (may have parents). Current implementation caches all Markers forever, with an option to clear the whole cache. Unclear how to use this mechanism to tag a log event with things like order ID, user ID and/or product ID. > ** Update: one way to address these issues is to create a KeyValueMarker implementation of the Marker interface. A single instance could contain multiple tags (key-value pairs of arbitrary type). Instances cannot be cached by name in the MarkerManager, but instead I imagine we can use a pool of KeyValueMarkers to reuse (so we would need to call release() or something when the log event is fully processed). > * *ThreadContext map*: the content of this map is merged into a properties map for each Log Event. The drawback of the ThreadContext API is that values must be Strings. We would like the ability to specify arbitrary Object values, or even primitive values. We can also take this opportunity to provide a garbage-free version of the ThreadContext (LOG4J2-1349) and the LogEvent properties map. > * *Direct user access to the LogEvent properties map*. LOG4J2-1010 suggests changing the Logger API to accomplish this, but there may be alternatives (needs more thought). Similar to the above, ideally we would like the ability to specify arbitrary Object values, or even primitive values, not just Strings. > * Other possibilities are *a new MessageFactory or a new LogEventFactory*. These would require invasive changes in the Log4j design across the board. It is not clear what the interfaces would look like for both upstream and downstream components. Improving the other mechanisms seems a better option. > *Problem 2: Dynamic filtering* > * What mechanism to use for increasing verbosity of events matching some condition? Global filters (on LogEvent properties or markers) may be a good candidate. > * How can operators enable/disable this on the fly? > * How can we provide convenience features for automatically reverting to the previous level of verbosity when some condition is met (e.g. after 10,000 events or after 5 minutes etc) -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org