Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3DB4610BCE for ; Mon, 3 Feb 2014 14:58:18 +0000 (UTC) Received: (qmail 29354 invoked by uid 500); 3 Feb 2014 14:58:16 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 29007 invoked by uid 500); 3 Feb 2014 14:58:13 -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 28788 invoked by uid 99); 3 Feb 2014 14:58:10 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 14:58:10 +0000 Date: Mon, 3 Feb 2014 14:58:10 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-500) Unloading one webapp unloads JMX MBeans for all webapps MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13889525#comment-13889525 ] Remko Popma commented on LOG4J2-500: ------------------------------------ This is still in progress, but I've made the following changes in revisions 1563745 and 1563911: *ObjectName changes* {color:red}(NEW JMX ObjectNames ARE INCOMPATIBLE WITH BETA-9 AND OLDER VERSIONS){color} * Appenders: {{org.apache.logging.log4j2:type=%s,component=Appenders,name=%s}} * Async Appenders: {{org.apache.logging.log4j2:type=%s,component=AsyncAppenders,name=%s}} * ContextSelector: {{org.apache.logging.log4j2:type=%s,component=ContextSelector}} * LoggerConfigs: {{org.apache.logging.log4j2:type=%s,component=Loggers,name=%s}} * LoggerContext: {{org.apache.logging.log4j2:type=%s}} * RingBuffer for all loggers async: {{org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer}} * RingBuffer for mixed sync/async: {{org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer}} * StatusLogger: {{org.apache.logging.log4j2:type=%s,component=StatusLogger}} (In case you wonder why these ObjectNames have {{type=LoggerContextName}} and not {{name=LoggerContextName}}. JConsole will assume that every {{ObjectName}} has a {{type}} property and will prioritize the {{type}} property when building the navigation tree. Google "JMX Best Practices" for details.) *JMX Client GUI* * Now has a tab for each active LoggerContext * Each LoggerContext tab is itself a tabbed pane with a LoggerStatus tab and a configuration editor tab * Updated screenshots in JMX Client GUI manual page *Granular Unloading* LoggerContext will now only unregister its own MBeans when stopped (unloading a webapp only unregisters the MBeans for that webapp) *TODO* * Test with web application (multiple active contexts, loading/unloading) * Document somewhere that the MBean ObjectNames are changing with this release * (Optional) Add screenshots with multiple active Logger Contexts * (Optional) Dynamically update client GUI when a web application is loaded and MBeans are registered (or unloaded and MBeans are unregistered) > Unloading one webapp unloads JMX MBeans for all webapps > ------------------------------------------------------- > > Key: LOG4J2-500 > URL: https://issues.apache.org/jira/browse/LOG4J2-500 > Project: Log4j 2 > Issue Type: Bug > Components: JMX > Affects Versions: 2.0-rc1 > Reporter: Remko Popma > Assignee: Remko Popma > > As a stopgap solution for LOG4J2-406, all MBeans are unregistered when a LoggerContext is stopped. > In an application server, multiple web applications can be deployed and undeployed independently and a better solution would only unregister the MBeans associated with the web application that is being undeployed. > Current MBean ObjectNames look like this (simplified): > {code} > ...StatusLogger > ...ContextSelector > ...LoggerContext,ctx=%s > ...LoggerConfig,ctx=%s,name=%s > ...Appender,ctx=%s,name=%s > ... > {code} > Assuming that every web application has a unique name, and this name becomes the name of the LoggerContext, then one solution would be to create StatusLogger and ContextSelector MBeans that have the LoggerContext name in their ObjectName: > {code} > ...StatusLogger,ctx=%s > ...ContextSelector,ctx=%s > ...LoggerContext,ctx=%s > ...LoggerConfig,ctx=%s,name=%s > ...Appender,ctx=%s,name=%s > ... > {code} > This way, every web application would have its own StatusLogger and ContextSelector MBeans. The MBeans may point to the same (shared) underlying StatusLogger and ContextSelector objects. When a web application is undeployed, unregistering all MBeans associated with the LoggerContext will not affect any MBeans associated with another web application (which has it own, separate, LoggerContext). -- This message was sent by Atlassian JIRA (v6.1.5#6160) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org