[ 
https://issues.apache.org/jira/browse/LOG4J2-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15498077#comment-15498077
 ] 

Darren Kelly commented on LOG4J2-1586:
--------------------------------------

[~rem...@yahoo.com] My apologies for any inconvenience, but I can no longer 
reproduce this issue. 

I initially recorded this problem on 2016-02-15 in my own tracking system, and 
something must have changed since, maybe even at the system level. I am also 
wondering (but not blaming without evidence) whether JRebel at that time was 
influencing it. I even had a screencast recording of the problem, so I am sure 
it was "real" and that I was indeed editing 
/build/web/WEB-INF/classes/log4j2.xml.

I will close this ticket for now, but for completeness I answer your questions:

> Isn't the  /build/web/WEB-INF/classes/ directory the place where Netbeans 
> will copy compiled class files to?
Yes.

> This directory is likely to be overwritten automatically when you rebuilld 
> the project.
Of course.

> It may be better to modify the source log4j2.xml file (and confirm that 
> saving the source log4j2.xml file also results in the copy in  
> /build/web/WEB-INF/classes/ being updated).

That's not the mode I am using the live edits of log4j2.xml for. I use 
transitory edits of /build/web/WEB-INF/classes/log4j2.xml to investigate the 
live running "in place" web app, especially debugging. Any logging modes I find 
useful for permanent operation are then included back in /src/java/log4j2.xml.

NetBeans web apps are by default setup so that edits of files under /web (such 
as XHTML) are copied to /build/web, but not edits under /src.

Thanks for the time you spent answering this report, closing.


> Automatic Reconfiguration not working when edit and save log4j2.xml in 
> NetBeans /build/WEB-INF
> ----------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1586
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1586
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators
>    Affects Versions: 2.5
>         Environment: Mac OS X
> NetBeans8.1
> Glassfish4.1.1
>            Reporter: Darren Kelly
>
> With a NetBeans web app deployed over the project's build folder (not as a 
> separate deployed WAR).
> From 
> https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration:
> {quote}
> When configured from a File, Log4j has the ability to automatically detect 
> changes to the configuration file and reconfigure itself. If the 
> monitorInterval attribute is specified on the configuration element and is 
> set to a non-zero value then the file will be checked the next time a log 
> event is evaluated and/or logged and the monitorInterval has elapsed since 
> the last check. The example below shows how to configure the attribute so 
> that the configuration file will be checked for changes only after at least 
> 30 seconds have elapsed. The minimum interval is 5 seconds.
> {quote}
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration monitorInterval="5" >
> ...
> </Configuration>
> {code}
> But when I edit and save the /build/web/WEB-INF/classes/log4j2.xml nothing 
> happens, the Automatic Reconfiguration magic fails. The log4j2.xml is 
> otherwise found and seems to work fine.
> When I use:
> {code}
> <Configuration status="ALL" monitorInterval="5">
> {code}
> and the webapp deployed directly from NetBeans8.1 into Glassfish4.1.1 (over 
> the .../build) I get: 
> {code}
> admin-listener(2) DEBUG Configuration 
> XmlConfiguration[location=/Users/.../webapp/build/web/WEB-IN‌​F/classes/log4j2.xml‌​]
>  initialized. 
> {code}
> But editing the log levels in that log4j2.xml file does not get caught.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to