Gregory Babski (JIRA | 11 Dec 14:30 2014
Picon

[jira] [Commented] (LOG4NET-447) MemoryAppender class is not thread safe


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

Gregory Babski commented on LOG4NET-447:
----------------------------------------

I did in fact implement a custom appender that extends MemoryAppender - based off of a much older version of
log4net. I came to depend on the memory appender when our code is run in a manual test framework -
redirecting log events to UI (rather than to file or syslog when the code runs ion production.) My
implementation was initially aimed at fixing the ArrayOutOfBounds Exception, as I discovered is now
fixed as described in https://issues.apache.org/jira/browse/LOG4NET-167.

I was updating our log4net dependencies and saw that fix and realised I could offer my changes for consideration.

Regarding the use obsolete tag - I defer to your experience, since I have never had to maintain widely used library.

Thanks for the feedback!

> MemoryAppender class is not thread safe
> ---------------------------------------
>
>                 Key: LOG4NET-447
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-447
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: .NET Framework 4.0 (Full Profile)
(Continue reading)

Dominik Psenner (JIRA | 10 Dec 12:12 2014
Picon

[jira] [Commented] (LOG4NET-447) MemoryAppender class is not thread safe


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

Dominik Psenner commented on LOG4NET-447:
-----------------------------------------

Hi there,

thanks for sharing your contribution. I've looked into the diff and it is straight forward and looks good.
Two things that I would like to be discussed/changed before I will apply the patch:

Marking the other methods as obsolete is probably not a wise decision since people might still want to get
events without clearing them or clear events without wasting memory to get them. In general, the memory
appender was not invented to be a threadsafe FIFO queue. This said, is there a special reason why you did not
create a new class that extends the MemoryAppender and adds your functionality?

Cheers

> MemoryAppender class is not thread safe
> ---------------------------------------
>
>                 Key: LOG4NET-447
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-447
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: .NET Framework 4.0 (Full Profile)
(Continue reading)

Gregory Babski (JIRA | 10 Dec 10:23 2014
Picon

[jira] [Updated] (LOG4NET-447) MemoryAppender class is not thread safe


     [
https://issues.apache.org/jira/browse/LOG4NET-447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Babski updated LOG4NET-447:
-----------------------------------
    Attachment: MemoryAppender_ThreadSafety.diff

Added patch file that fixes the issue.

The patch deprecates the Get and Clear methods. To retrieve and clear the event list use PopAllEvents. This
performs the same logical operations internally, but does so while holding a lock on the event list's
syncroot object.

> MemoryAppender class is not thread safe
> ---------------------------------------
>
>                 Key: LOG4NET-447
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-447
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: .NET Framework 4.0 (Full Profile)
>            Reporter: Gregory Babski
>            Priority: Minor
>         Attachments: MemoryAppenderTest.cs, MemoryAppender_ThreadSafety.diff
>
>
> The memory appender cannot be used safely in an application that uses more than one thread to interact with logging.
(Continue reading)

Gregory Babski (JIRA | 10 Dec 10:20 2014
Picon

[jira] [Updated] (LOG4NET-447) MemoryAppender class is not thread safe


     [
https://issues.apache.org/jira/browse/LOG4NET-447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Babski updated LOG4NET-447:
-----------------------------------
    Attachment: MemoryAppenderTest.cs

This is an nUnit test case to reproduce the issue.

> MemoryAppender class is not thread safe
> ---------------------------------------
>
>                 Key: LOG4NET-447
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-447
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: .NET Framework 4.0 (Full Profile)
>            Reporter: Gregory Babski
>            Priority: Minor
>         Attachments: MemoryAppenderTest.cs
>
>
> The memory appender cannot be used safely in an application that uses more than one thread to interact with logging.
> When using this code to retrieve and then clear events logged in the memory appender:
> var events = memoryAppender.GetEvents();
> memoryAppender.Clear();
> The executing thread may be preempted between these two calls and additional logging events logged.
(Continue reading)

Gregory Babski (JIRA | 10 Dec 10:15 2014
Picon

[jira] [Created] (LOG4NET-447) MemoryAppender class is not thread safe

Gregory Babski created LOG4NET-447:
--------------------------------------

             Summary: MemoryAppender class is not thread safe
                 Key: LOG4NET-447
                 URL: https://issues.apache.org/jira/browse/LOG4NET-447
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.13
         Environment: .NET Framework 4.0 (Full Profile)
            Reporter: Gregory Babski
            Priority: Minor

The memory appender cannot be used safely in an application that uses more than one thread to interact with logging.

When using this code to retrieve and then clear events logged in the memory appender:
var events = memoryAppender.GetEvents();
memoryAppender.Clear();

The executing thread may be preempted between these two calls and additional logging events logged. These
events are then cleared when the thread resumes execution - and are never seen/processed.

I expect to be be able to retrieve and clear the list of current events in one call that guarantees that no
events are ever lost.

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

(Continue reading)

Thang Cao (JIRA | 19 Nov 07:06 2014
Picon

[jira] [Commented] (LOG4NET-446) Google spreadsheet appender


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

Thang Cao commented on LOG4NET-446:
-----------------------------------

Thank you, Stefan and Justin !
Because it has some external dependencies (GData api sdk) so I publish it as a repository in github : https://github.com/ctthang/log4net.googlespreadsheetappender
Please add a link from log4net's website to it.
Thanks.

> Google spreadsheet appender
> ---------------------------
>
>                 Key: LOG4NET-446
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-446
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 1.2.13
>            Reporter: Thang Cao
>              Labels: features
>             Fix For: 1.3.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> This is not really an issue!
(Continue reading)

Stefan Bodewig (JIRA | 18 Nov 16:24 2014
Picon

[jira] [Commented] (LOG4NET-446) Google spreadsheet appender


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

Stefan Bodewig commented on LOG4NET-446:
----------------------------------------

Actually the official way would be to create a patch and attach it to this issue - github pull requests work as
well, pick your preferred option.

But please let us step back for a moment.  An appender can easily be added as separate DLL and doesn't need to
ship with log4net itself.  I don't know whether your code has any additional external dependencies,
log4net already has more than it should for some people (ASP.NET).  Maybe not bundling the appender with
log4net but rather publishing it as a separate download via github/bintray/nuget/you-name-it is the
better approach?  You'd decouple yourself from log4net's release cycle (realistically we currently
move at the speed of continental drift) and could make the appender available to users immediately.  We
could and should link from log4net's website to your appender prominently.

> Google spreadsheet appender
> ---------------------------
>
>                 Key: LOG4NET-446
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-446
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 1.2.13
>            Reporter: Thang Cao
>              Labels: features
(Continue reading)

Justin Dearing (JIRA | 17 Nov 15:34 2014
Picon

[jira] [Commented] (LOG4NET-446) Google spreadsheet appender


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

Justin Dearing commented on LOG4NET-446:
----------------------------------------

This looks awesome. I'm not personally on the log4net team, so I can't speak for if this would make it in. 

You would need to fork log4net on github, add your code to that fork and send a pull request. Reference that in
this jira ticket.

I'd be interested in using this appender. A poor man's loogly.

> Google spreadsheet appender
> ---------------------------
>
>                 Key: LOG4NET-446
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-446
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 1.2.13
>            Reporter: Thang Cao
>              Labels: features
>             Fix For: 1.3.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
(Continue reading)

Thang Cao (JIRA | 17 Nov 03:29 2014
Picon

[jira] [Created] (LOG4NET-446) Google spreadsheet appender

Thang Cao created LOG4NET-446:
---------------------------------

             Summary: Google spreadsheet appender
                 Key: LOG4NET-446
                 URL: https://issues.apache.org/jira/browse/LOG4NET-446
             Project: Log4net
          Issue Type: New Feature
          Components: Appenders
    Affects Versions: 1.2.13
            Reporter: Thang Cao
             Fix For: 1.3.0

This is not really an issue!
Someday ago I developed an appender to submit logging events to google spreadsheets for .net compact (2.0
++) and .net full.
I want to contribute it to log4net but the problem is that I do not know how to do.
Does everyone can help ?

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

Dominik Psenner (JIRA | 29 Oct 20:56 2014
Picon

[jira] [Commented] (LOG4NET-445) the log content can not write the right files by date


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

Dominik Psenner commented on LOG4NET-445:
-----------------------------------------

Is this actually a bug? If the local time was changed I would want to see that in the logfiles.

> the log content can not write the right files by date
> -----------------------------------------------------
>
>                 Key: LOG4NET-445
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-445
>             Project: Log4net
>          Issue Type: Task
>         Environment: visual studio 2010 ,net framework 4.0
>            Reporter: cwguang
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
>  Change the system date,for example ,change May  1st  to May 2nd,log4net will create a new log
20140502log.txt.but when you chang the date back to May 1st,log4net  still write the log content in
20140502log.txt. it should write the log content  to  20140501log.txt

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

(Continue reading)

cwguang (JIRA | 28 Oct 06:45 2014
Picon

[jira] [Created] (LOG4NET-445) the log content can not write the right files by date

cwguang created LOG4NET-445:
-------------------------------

             Summary: the log content can not write the right files by date
                 Key: LOG4NET-445
                 URL: https://issues.apache.org/jira/browse/LOG4NET-445
             Project: Log4net
          Issue Type: Task
         Environment: visual studio 2010 ,net framework 4.0
            Reporter: cwguang

 Change the system date,for example ,change May  1st  to May 2nd,log4net will create a new log
20140502log.txt.but when you chang the date back to May 1st,log4net  still write the log content in
20140502log.txt. it should write the log content  to  20140501log.txt

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


Gmane