Logging
powerVault uses Apache log4net as core logging library, and additionally PostSharp Diagnostics for extended Debug logging.
By default, all the logs are stored in a logfile located in ‘C:\Users\{USER}\AppData\Local\coolOrange\powerVault\Logs\powerVault.log’ and it contains only Infos, Warnings and Errors.
The log4net settings file is located in C:\Program Files\coolOrange\Modules\powerVault\powerVault.log4net.
Further information about log4Net Configurations can be found here.
When to change the logging behavior?
When you have issues or when you want to get more information about what went wrong, you can increase the loglevel.
Note
When changing the loglevel to DEBUG PostSharp Diagnostics will
be enabled and will log all the function calls into the log files.
This could cause performance issues
LogFile
You can see, that there are multiple logging-Appenders used.
If you want to change the Logging Levels for the logfile, please visit following appender:
1 | <appender name="FileAppender" type="log4net.Appender.RollingFileAppender"> |
In the lines
1 2 3 4 5 | <root> <level value="INFO" /> <appender-ref ref="FileAppender"/> <appender-ref ref="ColoredConsoleAppender" /> </root> |
you can configure the loglevel for all appenders.
You could set the level to “DEBUG”, than all the appenders will log in debug.
In the line
1 | <param name="File" value="${LOCALAPPDATA}\\coolOrange\\powerVault\\Logs\\powerVault.log" /> |
you can configure the outputpath and name of the logfile.
PowerShell IDE
PowerShell IDEs like PowerShell ISE (and the powerShell console) are configured to show the logging levels in a different color.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <mapping> <level value="DEBUG" /> <foreColor value="Black" /> <backColor value="White" /> </mapping> <mapping> <level value="INFO" /> <backColor value="DarkGreen" /> </mapping> <mapping> <level value="WARN" /> <foreColor value="Black" /> <backColor value="Yellow" /> </mapping> <mapping> <level value="ERROR" /> <backColor value="Red" /> </mapping> <mapping> <level value="FATAL" /> <backColor value="DarkRed" /> </mapping> |
These and many other options can be configured in the appender named ColoredConsoleAppender.