0

log4net デバッグ モードがオンのときに New-Logger 関数が機能しない理由がわかりましたか? すなわち。いつ

<log4net debug="true">
...
</log4net>

Trying to get log4net working with PowerShell (with a log4net config file in the mix)にあるサンプル コードのデバッグ属性を変更すると、次のトレースが表示されます。

log4net: Configuration update mode [Merge].
log4net: Logger [root] Level string is [ALL].
log4net: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: Loading Appender [LogFileAppender] type: [log4net.Appender.FileAppender]
log4net: Setting Property [File] to String value [C:\Users\XXX\Documents\Snippets\LOGS\LogTest2.txt]
log4net: Setting Property [AppendToFile] to Boolean value [True]
log4net: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Setting Property [ConversionPattern] to String value [%date [%thread] %-5level %logger [%ndc] - %message%newline]
log4net: Converter [date] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [thread] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [] ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [level] Option [] Format [min=5,max=2147483647,leftAlign=True]
log4net: Converter [literal] Option [ ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [logger] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [ndc] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [] - ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Setting Property [Layout] to object [log4net.Layout.PatternLayout]
log4net: Opening file for writing [C:\Users\XXX\Documents\Snippets\LOGS\LogTest2.txt] append [True]
log4net: reated Appender [LogFileAppender]
log4net: Adding appender named [LogFileAppender] to logger [root].
log4net: Retrieving an instance of log4net.Repository.Logger for logger [new-presentation].
log4net: Setting [new-presentation] additivity to [True].
log4net: Logger [new-presentation] Level string is [ALL].
log4net: Logger [new-presentation] level set to [name="ALL",value=-2147483648].
log4net: Adding appender named [LogFileAppender] to logger [new-presentation].
log4net: Hierarchy Threshold []
Method invocation failed because [System.Object[]] doesn't contain a method named 'Info'.
At C:\Users\XXX\Documents\Snippets\Sample.ps1:58 char:10
+ $Log.Info <<<< ($MsgTable.StartMsg)
+ CategoryInfo          : InvalidOperation: (Info:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

Method invocation failed because [System.Object[]] doesn't contain a method named 'Info'.
At C:\Users\XXX\Documents\Snippets\Sample.ps1:68 char:10
+ $Log.Info <<<< ($MsgTable.StopMsg)
+ CategoryInfo          : InvalidOperation: (Info:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
4

0 に答える 0