Logging

powerLoad (bcpToolkit) tools use 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\bcpToolkit\Logs\bcpToolkit.log’ and it contains Infos, Warnings and Errors.
Perhaps you can find backups of previous logfiles in this directory.

The log4net settings file is located in C:\Program Files\coolOrange\bcpToolkit\bcpToolkit.log4net.
Further information about log4Net Configurations can be found here.

You can change the logging behaviour of:

When to change the logging behavior?

When you have issues or when you want to get a more detailed knowledge 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

Additionally you can change the logfile location or integrate the logging mechanism into your administrative environment by using build in EventLogMessages etc.

Following section is used to control the logging behaviour for all tools:

 63 64 65  ... 

For the moment only following LogAppender is used:

LogFile

This is the main LogAppender used in all the loggers. If you want to change the logging level in the logfile, please visit following appender:

 3  

In the line

 6  

you can configure the outputpath and name of the logfile.

Since this appender has no configured LevelRangeFilter, its loggingLevel has to be configured on the loggers.
In the lines

 63 64 65 66  

you can configure the logging level. You could set the level to “DEBUG”, then all the levels between the range Debug and Fatal will be logged.

bcpViewer

Following section is used to control the logging behaviour for the bcpViewer.exe and it’s engine logic:

 68  

In order to configure sub-functionalities like the UserInterface, the following configuration section could be used:

 70  

This is the place where you want to increase the logging level when you need more detailed informations about whats happening in the bcpViewer Database.

 72  

For all this sections, only the LogFile appender is used.

PowerShell IDE

When using bcpToolkit cmdlets in PowerShell environments, logs are written to the PowerShell Console Window.
Following section is used to control the logging behaviour for the Cmdlets of this module:

 80  ... 

In order to customize the logging level in the console window, visit following appender that is used in addition to the LogFile:

ColoredConsoleAppender

ColoredConsoleAppenders are working for PowerShell IDE’s that support console windows.

 23  

In the lines

 50 51 52 53  

you can configure the required logging level. You could set the minimal filter level to “DEBUG”, than all the levels between the range Debug and Fatal will be logged.

We are using a ColoredConsoleAppender, therefore you could also change the colors of the messages, depending on their log level:

 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44  

Troubleshooting

The powerShell ISE currently does not support console logs at all.

In addition to the earlier described logging section ‘bcpToolkit.Cmdlets’, following section can be adjusted for PowerShell environments as well, since they make use of the .NET library internally.

Projects using .NET Library

When using the bcpDevKit .NET library in custom projects, logging can be controlled in following section:

 75  ... 

In addition to the LogFile, all projects that support console windows will make use of the configuration for the ColoredConsoleAppender too.
 56 57 58 59 60