Question [Outil]Le système de log nommé Log4NET

Plus d'informations
il y a 6 ans 7 mois #24121 par Laurent Dardenne
Nouvelle version 2.2.0
Quelques corrections de bug mineurs

Les fonctions Initialize-Log4NetModule et Initialize-Log4NetScript sont obsolètes.
Utilisez désormais la fonction Initialize-Log4Net.

Ajout de 2 démos d'usage du module au sein d'un script.<br><br>Message édité par: Laurent Dardenne, à: 2/10/17 21:47

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 5 ans 8 mois #25747 par Laurent Dardenne
Nouvelle version 3.0.2 :

2018-07-15 Version 3.0.2
Add
Log files are now created with the UTF-8 encoding by default.
PSWarn method in TypeData (ETS).
PSDebugFormat, PSInfoFormat, PSWarnFormat, PSErrorFormat, PSFatalFormat methods in TypeData (ETS).
Add 'Get-Log4NetGlobalContextProperty' function.
Add 'Get-Log4NetConfiguration' function.

2018-05-18 Version 3.0.1
Fix
function Start-Log4Net
When the module was loaded from an UNC path, the constructor of the class System.IO.fileInfo
raised a NotSupportedException exception.

2018-05-06 Version 3.0.0
Breaking change
The function Initialize-Log4Net dot not use script scope by default with a xml configuration ($XmlConfigPath)
The caller, in the case of a module using its own loggers, must specify the scope 'Script'

The following code :
$InitializeLogging=[scriptblock]::Create(\&quot;${function:Initialize-Log4Net}\&quot;)
$Params=@{
RepositoryName = $Script:lg4n_ModuleName
XmlConfigPath = \&quot;$psScriptRoot\Log4Net.Config.xml\&quot;
DefaultLogFilePath = \&quot;$psScriptRoot\Logs\${Script:lg4n_ModuleName}.log\&quot;
}
&amp;$InitializeLogging @Params
becomes
$InitializeLogging=[scriptblock]::Create(\&quot;${function:Initialize-Log4Net}\&quot;)
$Params=@{
RepositoryName = $Script:lg4n_ModuleName
XmlConfigPath = \&quot;$psScriptRoot\Log4Net.Config.xml\&quot;
DefaultLogFilePath = \&quot;$psScriptRoot\Logs\${Script:lg4n_ModuleName}.log\&quot;
Scope='Script'
}
&amp;$InitializeLogging @Params

Add
Function Get-DefaultRepository : return the défault repository. See Get-DefaultRepositoryName
Get-Log4NetLogger : add -All parameter. Return all loggers of a repository

Change
Get-Log4NetAppenderFileName : rename the parameter 'ModuleName' to 'RepositoryName'
rename the alias 'RepositoryName' to 'ModuleName'

<br><br>Message édité par: Laurent Dardenne, à: 15/07/18 12:39

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.081 secondes
Propulsé par Kunena