Question [Outil]Le système de log nommé Log4NET
- Laurent Dardenne
- Auteur du sujet
- Hors Ligne
- Modérateur
-
- Messages : 6290
- Remerciements reçus 67
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.
- Laurent Dardenne
- Auteur du sujet
- Hors Ligne
- Modérateur
-
- Messages : 6290
- Remerciements reçus 67
<br><br>Message édité par: Laurent Dardenne, à: 15/07/18 12:392018-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(\"${function:Initialize-Log4Net}\")
$Params=@{
RepositoryName = $Script:lg4n_ModuleName
XmlConfigPath = \"$psScriptRoot\Log4Net.Config.xml\"
DefaultLogFilePath = \"$psScriptRoot\Logs\${Script:lg4n_ModuleName}.log\"
}
&$InitializeLogging @Params
becomes
$InitializeLogging=[scriptblock]::Create(\"${function:Initialize-Log4Net}\")
$Params=@{
RepositoryName = $Script:lg4n_ModuleName
XmlConfigPath = \"$psScriptRoot\Log4Net.Config.xml\"
DefaultLogFilePath = \"$psScriptRoot\Logs\${Script:lg4n_ModuleName}.log\"
Scope='Script'
}
&$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'
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- Vous êtes ici :
-
Accueil
-
forum
-
PowerShell
-
Contributions à la communauté
- [Outil]Le système de log nommé Log4NET