[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-18 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15585295#comment-15585295
 ] 

Stefan Bodewig commented on LOG4NET-511:


you are right, done.

> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-18 Thread JocularJoe (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15585224#comment-15585224
 ] 

JocularJoe commented on LOG4NET-511:


Thanks for doing this, but just one point.


AppenderSkeleton.Flush should return true.


Only a buffering or asynchronous appender would ever return false, generally 
because the timeout has expired before all buffered events have been processed. 
 Other appenders will want to inherit an implementation that returns true.



> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-17 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15584432#comment-15584432
 ] 

Stefan Bodewig commented on LOG4NET-511:


has been trivial enough for me to do ;-)

svn revision 1765389

> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-17 Thread JocularJoe (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15582379#comment-15582379
 ] 

JocularJoe commented on LOG4NET-511:


I'm happy to create a pull request for this, or maybe you prefer to do it 
yourself as it's so trivial?



> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-17 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15582290#comment-15582290
 ] 

Stefan Bodewig commented on LOG4NET-511:


fine with me

> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-17 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15581385#comment-15581385
 ] 

Stefan Bodewig commented on LOG4NET-511:


wouldn't you still need {{IFlushable}} for {{ILoggerRepository}}'s interaction 
with {{LogManager}}?

> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-16 Thread Joe (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15581186#comment-15581186
 ] 

Joe commented on LOG4NET-511:
-

 [~bodewig] - it occurs to me that it would have been better to implement 
IFlushable as an empty virtual method in AppenderSkeleton.

A trivial change now, but a breaking change once it's released.

What do you think?  

> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 2.0.6
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15579746#comment-15579746
 ] 

ASF GitHub Bot commented on LOG4NET-511:


Github user bodewig commented on the issue:

https://github.com/apache/log4net/pull/37
  
Many thanks @JJoe2 and sorry for the hassle you had to go through.

tracked as LOG4NET-511 - https://issues.apache.org/jira/browse/LOG4NET-511




> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-10-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15578731#comment-15578731
 ] 

ASF GitHub Bot commented on LOG4NET-511:


Github user JJoe2 closed the pull request at:

https://github.com/apache/log4net/pull/25


> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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


[jira] [Commented] (LOG4NET-511) API to flush appenders

2016-04-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15255396#comment-15255396
 ] 

ASF GitHub Bot commented on LOG4NET-511:


GitHub user JJoe2 opened a pull request:

https://github.com/apache/log4net/pull/25

API to flush appenders that buffer logging data

Implementation of https://issues.apache.org/jira/browse/LOG4NET-511

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/JJoe2/log4net wip/Flush

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/log4net/pull/25.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #25


commit a66d2fc61c4a1cfd8317aee41385ef6c43373ffc
Author: JoeJoe 
Date:   2016-04-22T19:21:07Z

Use UTC internally to avoid ambiguous times

commit 9e9f1759d6a80594cd2d12bd54a9e3af9e7cfaa0
Author: JoeJoe 
Date:   2016-04-23T19:58:36Z

Implement flushing of appenders that buffer data




> API to flush appenders
> --
>
> Key: LOG4NET-511
> URL: https://issues.apache.org/jira/browse/LOG4NET-511
> Project: Log4net
>  Issue Type: Wish
>  Components: Appenders, Core
>Affects Versions: 1.2.15
> Environment: NA
>Reporter: Joe
>Priority: Minor
> Fix For: 1.2.16
>
>
> I would like to see an API that flushes any appenders that have buffered 
> data. E.g. a method LogManager.Flush().  An application might call such a 
> method at regular intervals, e.g. on a Timer.
> A naive implementation with the current log4net would iterate through 
> appenders, looking for those that support flushing, and call the appender's 
> flush method, e.g.:
> foreach (IAppender appender in 
>  LogManager.GetRepository().GetAppenders())
> {
> BufferingAppenderSkeleton bas = appender 
> as BufferingAppenderSkeleton;  
> if (bas != null) bas.Flush();
> }
> But (a) I'm not sure this is thread-safe and (b) there are potentially other 
> appenders that may want to be able to flush data (e.g. a TextWriterAppender 
> with ImmediateFlush = false).
> The request consists of:
> - Add an interface, IFlushableAppender or equivalent, with a single method 
> Flush().
> - Implement this interface in all relevant appenders 
> (BufferingAppenderSkeleton, TextWriterAppender, ...)
> - Add a thread-safe static Flush() method to LogManager.



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