logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1354) No configuration reload is triggered under Windows when replacing the configuration file with one that has older last modified date.
Date Tue, 05 Apr 2016 18:19:26 GMT

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

Gary Gregory commented on LOG4J2-1354:
--------------------------------------

I would guess that the reporter of this ticket would say "because it is different".

What matters it seems is that the file is different, not it's "age".

If I have a couple complex configurations I want to toggle between. How do I do that. Myself,
I comment in and out XML fragments ATM, that's quite a pain. Moving files around is easy in
comparison. You might have some redundancy in the various files, but that's part of the trade-off.

> No configuration reload is triggered under Windows when replacing the configuration file
with one that has older last modified date.
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1354
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1354
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators
>    Affects Versions: 2.5
>            Reporter: Arkadiusz Adolph
>            Priority: Minor
>
> Due to the way Windows handles the date modified attribute on copied or overwritten files
log4j doesn't pick up the changes and doesn't reload the configuration.
> Example:
> The currently used log4j configuration file (date modified = 2pm) is replaced at 3pm
by another configuration file (date modified= 1pm). Under Windows, the date modified of this
file is now 1pm. This will not trigger log4j configuration to reload, since the new date is
smaller than the original.
> Maybe changing
> {noformat}
> if (lastModfied > fileMonitor.lastModified) {
> {noformat}
> to
> {noformat}
> if (lastModfied != fileMonitor.lastModified) {
> {noformat}
> in in org.apache.logging.log4j.core.util.WatchManager.WatchWorker.run() could be an easy
solution for this. 



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


Mime
View raw message