[
https://issues.apache.org/jira/browse/LOG4NET-594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dominik Psenner reopened LOG4NET-594:
-------------------------------------
If this is the case, we might be missing a required dependency to
System.Reflection.TypeExtensions
([https://www.nuget.org/packages/System.Reflection.TypeExtensions/).] I hate to
say this but we are currently unable to run the tests against the netstandard
target and this is surely one of the cases that simply slipped through because
of that. We have to figure out why the netstandard tests block in our CI and
are then cancelled after the four hour timeout of the build job.
Would you like to clone log4net on github and open a pull request that contains
a patch to the netstandard csproj file?
> repository.GetAppenders() returns log4net.Appender.IAppender[0]
> ---------------------------------------------------------------
>
> Key: LOG4NET-594
> URL: https://issues.apache.org/jira/browse/LOG4NET-594
> Project: Log4net
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.0.8
> Environment: Windows PowerShell Console
> Reporter: Rajesh Balakrishnan
> Assignee: Dominik Psenner
> Priority: Blocker
> Labels: windows
> Fix For: 2.0.8
>
> Attachments: Log4Net.config
>
>
> Hi,
> We are migrating our code base into .Net standard to support both Windows
> PowerShell console and PowerShell core. We are using log4net 2.0.8 as third
> party reference with log4Net.config file. There is no build issue with this.
> But, we have observed "repository.GetAppenders()" returns
> log4net.Appender.IAppender[0] in Windows PowerShell Console whereas the same
> is working as expected in PowerShell Core Console. In Windows PowerShell
> console, It looks like it is not reading the appenders confoguration from
> log4net.config.
> +*Code:*+
> log4net.Repository.ILoggerRepository repository =
> log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Logger.Repository;
> var appenders = repository.GetAppenders();
> +*Here is log4net.config:*+
> <configuration>
> <configSections>
> <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
> </configSections>
> <log4net>
> <appender name="FileAppender" type="log4net.Appender.FileAppender">
> <file value="FileLog.txt"/>
> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
> <appendToFile value="true"/>
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%date [%thread] [%logger] %level -
> %message%newline%exception"/>
> </layout>
> </appender>
> <appender name="RollingFileAppender"
> type="log4net.Appender.RollingFileAppender">
> <file value="%date.log"/>
> <PreserveLogFileNameExtension value="true" />
> <appendToFile value="true"/>
> <rollingStyle value="Size"/>
> <maximumFileSize value="10MB"/>
> <maxSizeRollBackups value="5"/>
> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%date %stacktrace %level -
> %message%newline%exception"/>
> </layout>
> </appender>
> <root>
> <level value="DEBUG"/>
> <appender-ref ref="RollingFileAppender"/>
> </root>
> </log4net>
> <startup>
> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
> </startup>
> </configuration>
>
> Please let us confirm is it a bug in log4net or something we need to correct
> from our end.
> Thank you:)
>
> *Regards,*
> Rajesh Balakrishnan
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)