Dominik Psenner (JIRA | 1 Oct 16:40 2014
Picon

[jira] [Commented] (LOG4NET-442) ReconnectOnError


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

Dominik Psenner commented on LOG4NET-442:
-----------------------------------------

From what I can understand out of the log this indicates that the provider did pass the check if it is
connected and went straight to the point where it opens a transaction:

   at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction()
   at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events)

Whereas it should reconnect a little earlier if this condition holds:

if (m_reconnectOnError && (m_dbConnection == null || m_dbConnection.State != ConnectionState.Open))
{
	LogLog.Debug(declaringType, "Attempting to reconnect to database. Current Connection State: " +
((m_dbConnection==null)?SystemInfo.NullText:m_dbConnection.State.ToString()) );

Thus it is possible that the connection went away just a jiffy after the check and since there is no other call
to SendBuffer() it is not possible to determine if log4net tried to reconnect. Would you please retry your test?

My best bet at the moment is that the provider tries to handle the disconnection internally and does thus not
report the broken connection state at m_dbConnection.State. Can you debug this?

Please note also that connection timeouts can take quite a long time (even more than a few minutes) and thus
you may have to send log events for quite a long time before log4net gets a turn to finish the previous
SendBuffer and do the next call to SendBuffer.
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 14:02 2014
Picon

[jira] [Commented] (LOG4NET-442) ReconnectOnError


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

Alessio Sanguineti commented on LOG4NET-442:
--------------------------------------------

yes, new events were sent to the logger but they were somehow discarded (not written).

We also waited some minutes after the server restart, but no writing on the DB happened

> ReconnectOnError 
> -----------------
>
>                 Key: LOG4NET-442
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-442
>             Project: Log4net
>          Issue Type: Bug
>          Components: Builds
>    Affects Versions: 1.2.13
>         Environment: Microsoft .NET 4.5
>            Reporter: Alessio Sanguineti
>         Attachments: log4net.txt
>
>
> Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we set the parameter
"ReconnectOnError" to true in the ADO.Net Appender configuration. 
> Even if the property seems to be read correctly (as visible on the log), whenever the server is not
reachable for a while the appender does not reconnect anymore thus not logging anything else.
(Continue reading)

Dominik Psenner (JIRA | 1 Oct 13:25 2014
Picon

[jira] [Commented] (LOG4NET-442) ReconnectOnError


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

Dominik Psenner commented on LOG4NET-442:
-----------------------------------------

The appender failed to connect to the sql server when trying to send the buffer. I would expect the appender
to discard the events and only retry to connect when the next events come in. So the question is: have you
"created" some log events after that the server was turned on again and was running successfully?
Powering the server up might take some time and you will have to consider to wait for that time to pass by.

> ReconnectOnError 
> -----------------
>
>                 Key: LOG4NET-442
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-442
>             Project: Log4net
>          Issue Type: Bug
>          Components: Builds
>    Affects Versions: 1.2.13
>         Environment: Microsoft .NET 4.5
>            Reporter: Alessio Sanguineti
>         Attachments: log4net.txt
>
>
> Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we set the parameter
"ReconnectOnError" to true in the ADO.Net Appender configuration. 
> Even if the property seems to be read correctly (as visible on the log), whenever the server is not
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 10:56 2014
Picon

[jira] [Updated] (LOG4NET-442) ReconnectOnError


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

Alessio Sanguineti updated LOG4NET-442:
---------------------------------------
    Description: 
Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we set the parameter
"ReconnectOnError" to true in the ADO.Net Appender configuration. 

Even if the property seems to be read correctly (as visible on the log), whenever the server is not reachable
for a while the appender does not reconnect anymore thus not logging anything else.

We get the log file attached of a test where we turned off SQL Server for about 1 minute before restarting it.

Thank you.
Regards

  was:
Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we have set the parameter
"ReconnectOnError" to true in the LogConfig.xml. As a test, we have stopped sql server and then
re-started it, but  the logger did not reconnect. We get the following log file:

log4net: log4net assembly [log4net, Version=1.2.13.0, Culture=neutral,
PublicKeyToken=1b44e1d426115821]. Loaded from
[C:\Projects\SIdG\TranslationEngine\bin\Debug\log4net.dll]. (.NET Runtime [4.0.30319.18444]
on Microsoft Windows NT 6.1.7601 Service Pack 1)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 10:52 2014
Picon

[jira] [Updated] (LOG4NET-442) ReconnectOnError


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

Alessio Sanguineti updated LOG4NET-442:
---------------------------------------
    Attachment: log4net.txt

Log file

> ReconnectOnError 
> -----------------
>
>                 Key: LOG4NET-442
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-442
>             Project: Log4net
>          Issue Type: Bug
>          Components: Builds
>    Affects Versions: 1.2.13
>         Environment: Microsoft .NET 4.5
>            Reporter: Alessio Sanguineti
>         Attachments: log4net.txt
>
>
> Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we have set the parameter
"ReconnectOnError" to true in the LogConfig.xml. As a test, we have stopped sql server and then
re-started it, but  the logger did not reconnect. We get the following log file:
> log4net: log4net assembly [log4net, Version=1.2.13.0, Culture=neutral,
PublicKeyToken=1b44e1d426115821]. Loaded from
[C:\Projects\SIdG\TranslationEngine\bin\Debug\log4net.dll]. (.NET Runtime [4.0.30319.18444]
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 10:46 2014
Picon

[jira] [Updated] (LOG4NET-442) ReconnectOnError


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

Alessio Sanguineti updated LOG4NET-442:
---------------------------------------
    Description: 
Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we have set the parameter "ReconnectOnError" to true in the LogConfig.xml. As a test, we have stopped sql server and then re-started it, but  the logger did not reconnect. We get the following log file:

log4net: log4net assembly [log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [C:\Projects\SIdG\TranslationEngine\bin\Debug\log4net.dll]. (.NET Runtime [4.0.30319.18444] on Microsoft Windows NT 6.1.7601 Service Pack 1)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Projects\SIdG\TranslationEngine\bin\Debug\TranslationEngine.exe]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: configuring repository [log4net-default-repository] using file [C:\Projects\SIdG\TranslationEngine\bin\Debug\/LogConfig.xml] watching for file updates
log4net: configuring repository [log4net-default-repository] using file [C:\Projects\SIdG\TranslationEngine\bin\Debug\/LogConfig.xml]
log4net: configuring repository [log4net-default-repository] using stream
log4net: loading XML configuration
log4net: Configuring Repository [log4net-default-repository]
log4net: Configuration update mode [Merge].
log4net: Logger [root] Level string is [DEBUG].
log4net: Logger [root] level set to [name="DEBUG",value=30000].
log4net: Loading Appender [AdoNetAppender] type: [log4net.Appender.AdoNetAppender]
log4net: Setting Property [BufferSize] to Int32 value [1]
log4net: Setting Property [ReconnectOnError] to Boolean value [True]
log4net: Setting Property [ConnectionType] to String value [System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]
log4net: Setting Property [ConnectionString] to String value [data source=HYLSRVSIDG;initial catalog=SIDG_Log_AS;integrated security=false;persist security info=True;User ID=sa;Password=***;connection timeout=10; ConnectRetryCount=50; ConnectRetryInterval =30]
log4net: Setting Property [CommandText] to String value [INSERT INTO dbo.Log ([Message],[Level],[Thread],[Logger],[Exception],[Timestamp],[Operation_Instance],[Operation_ID]) VALUES ( <at> message, <at> log_level,  <at> thread,   <at> logger,   <at> exception, <at> log_date,  <at> opinst,  <at> opid)]
log4net: Setting Property [ParameterName] to String value [ <at> log_date]
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 10:45 2014
Picon

[jira] [Updated] (LOG4NET-442) ReconnectOnError


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

Alessio Sanguineti updated LOG4NET-442:
---------------------------------------
    Description: 
Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we have set the parameter "ReconnectOnError" to true in the LogConfig.xml. As a test, we have stopped sql server and then re-started it, but  the logger didnot reconnect. We get the following log file:

log4net: log4net assembly [log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [C:\Projects\SIdG\TranslationEngine\bin\Debug\log4net.dll]. (.NET Runtime [4.0.30319.18444] on Microsoft Windows NT 6.1.7601 Service Pack 1)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Projects\SIdG\TranslationEngine\bin\Debug\TranslationEngine.exe]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: configuring repository [log4net-default-repository] using file [C:\Projects\SIdG\TranslationEngine\bin\Debug\/LogConfig.xml] watching for file updates
log4net: configuring repository [log4net-default-repository] using file [C:\Projects\SIdG\TranslationEngine\bin\Debug\/LogConfig.xml]
log4net: configuring repository [log4net-default-repository] using stream
log4net: loading XML configuration
log4net: Configuring Repository [log4net-default-repository]
log4net: Configuration update mode [Merge].
log4net: Logger [root] Level string is [DEBUG].
log4net: Logger [root] level set to [name="DEBUG",value=30000].
log4net: Loading Appender [AdoNetAppender] type: [log4net.Appender.AdoNetAppender]
log4net: Setting Property [BufferSize] to Int32 value [1]
log4net: Setting Property [ReconnectOnError] to Boolean value [True]
log4net: Setting Property [ConnectionType] to String value [System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]
log4net: Setting Property [ConnectionString] to String value [data source=HYLSRVSIDG;initial catalog=SIDG_Log_AS;integrated security=false;persist security info=True;User ID=sa;Password=***;connection timeout=10; ConnectRetryCount=50; ConnectRetryInterval =30]
log4net: Setting Property [CommandText] to String value [INSERT INTO dbo.Log ([Message],[Level],[Thread],[Logger],[Exception],[Timestamp],[Operation_Instance],[Operation_ID]) VALUES ( <at> message, <at> log_level,  <at> thread,   <at> logger,   <at> exception, <at> log_date,  <at> opinst,  <at> opid)]
log4net: Setting Property [ParameterName] to String value [ <at> log_date]
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 10:45 2014
Picon

[jira] [Updated] (LOG4NET-442) ReconnectOnError


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

Alessio Sanguineti updated LOG4NET-442:
---------------------------------------
    Description: 
Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we have set the parameter "ReconnectOnError" to true in the LogConfig.xml. As a test, we have stopped sql server and then re-started it, but  the logger did not reconnect. We get the following log file:

log4net: log4net assembly [log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [C:\Projects\SIdG\TranslationEngine\bin\Debug\log4net.dll]. (.NET Runtime [4.0.30319.18444] on Microsoft Windows NT 6.1.7601 Service Pack 1)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Projects\SIdG\TranslationEngine\bin\Debug\TranslationEngine.exe]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: configuring repository [log4net-default-repository] using file [C:\Projects\SIdG\TranslationEngine\bin\Debug\/LogConfig.xml] watching for file updates
log4net: configuring repository [log4net-default-repository] using file [C:\Projects\SIdG\TranslationEngine\bin\Debug\/LogConfig.xml]
log4net: configuring repository [log4net-default-repository] using stream
log4net: loading XML configuration
log4net: Configuring Repository [log4net-default-repository]
log4net: Configuration update mode [Merge].
log4net: Logger [root] Level string is [DEBUG].
log4net: Logger [root] level set to [name="DEBUG",value=30000].
log4net: Loading Appender [AdoNetAppender] type: [log4net.Appender.AdoNetAppender]
log4net: Setting Property [BufferSize] to Int32 value [1]
log4net: Setting Property [ReconnectOnError] to Boolean value [True]
log4net: Setting Property [ConnectionType] to String value [System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]
log4net: Setting Property [ConnectionString] to String value [data source=HYLSRVSIDG;initial catalog=SIDG_Log_AS;integrated security=false;persist security info=True;User ID=sa;Password=***;connection timeout=10; ConnectRetryCount=50; ConnectRetryInterval =30]
log4net: Setting Property [CommandText] to String value [INSERT INTO dbo.Log ([Message],[Level],[Thread],[Logger],[Exception],[Timestamp],[Operation_Instance],[Operation_ID]) VALUES ( <at> message, <at> log_level,  <at> thread,   <at> logger,   <at> exception, <at> log_date,  <at> opinst,  <at> opid)]
log4net: Setting Property [ParameterName] to String value [ <at> log_date]
(Continue reading)

Alessio Sanguineti (JIRA | 1 Oct 10:44 2014
Picon

[jira] [Created] (LOG4NET-442) ReconnectOnError

Alessio Sanguineti created LOG4NET-442:
------------------------------------------

             Summary: ReconnectOnError 
                 Key: LOG4NET-442
                 URL: https://issues.apache.org/jira/browse/LOG4NET-442
             Project: Log4net
          Issue Type: Bug
          Components: Builds
    Affects Versions: 1.2.13
         Environment: Microsoft .NET 4.5
            Reporter: Alessio Sanguineti

Hello, in our .NET application using Log4Net to log on a Sql Server 2014 database, we have set the parameter
"ReconnectOnError" to true in the LogConfig.xml. As a test, we have stopped sql server and then
re-started it, but  the logger does not reconnect. We get the following log file:

log4net: log4net assembly [log4net, Version=1.2.13.0, Culture=neutral,
PublicKeyToken=1b44e1d426115821]. Loaded from
[C:\Projects\SIdG\TranslationEngine\bin\Debug\log4net.dll]. (.NET Runtime [4.0.30319.18444]
on Microsoft Windows NT 6.1.7601 Service Pack 1)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
Loaded From [C:\Projects\SIdG\TranslationEngine\bin\Debug\TranslationEngine.exe]
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
does not have a RepositoryAttribute specified.
log4net: Assembly [TranslationEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
(Continue reading)

jrv (JIRA | 24 Sep 16:12 2014
Picon

[jira] [Created] (LOG4NET-441) FAQ should have Q&A about initialization

jrv created LOG4NET-441:
---------------------------

             Summary: FAQ should have Q&A about initialization
                 Key: LOG4NET-441
                 URL: https://issues.apache.org/jira/browse/LOG4NET-441
             Project: Log4net
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 1.2.13
            Reporter: jrv
            Priority: Minor

I set up a sample application to try out log4net but nothing happened. I had linked the assembly, called the
methods and set up the config, but I neither called one of the configurators nor included one of the
configurator attributes. While in retrospect it's stupid on my part, it also seems to be a common cry for
help (search "log4net not working"). The FAQ Q&A (under troubleshooting) could be something like:

Q: Why isn't log4net working at all?
A: You may have overlooked initialization code for log4net in your application. log4net can be
initialized explicitly by calling one of the configurators (e.g. BasicConfigurator, DOMConfigurator
or XmlConfigurator in the log4net.Config namespace, or implicitly by including one of the configurator
attributes (e.g. [XmlConfiguratorAttribute], [DOMConfiguratorAttribute]) in the assembly where
log4net is first used. See xxxx and yyyy for more information.

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

(Continue reading)

Michael Grondines (JIRA | 11 Sep 21:52 2014
Picon

[jira] [Closed] (LOG4NET-440) Hierarchy does not reset loggers on configuration changes


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

Michael Grondines closed LOG4NET-440.
-------------------------------------
    Resolution: Not a Problem

Need to put the update mode to "Overwrite" instead of the default "Merge"

<log4net update="Overwrite">

> Hierarchy does not reset loggers on configuration changes
> ---------------------------------------------------------
>
>                 Key: LOG4NET-440
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-440
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.13
>         Environment: .Net framework application(s)
>            Reporter: Michael Grondines
>            Priority: Minor
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Hi,
> We are using log4net in an application in .Net 3.5 where we cant to log things via hierarchically using the
assemblies. For instance we have : "Program.Sub.Utilities"
(Continue reading)


Gmane