XrmToolBox provides a classLogManagerclass that allows you to manage log files.

Instantiate LogManager class

First, instantiate the class LogManager
var lm = new LogManager(typeof(SampleTool), ConnectionDetail);

First argument is the type of the tool. It instructs the LogManager class to create a file with the name of your tool
Second argument, which is optionnal, is used to indicate in the log file from which connection the information is received

The resulting log file would be named something like : MscrmTools.SampleTool.log

Available properties

Name Description
FilePath Path of the log file

Available methods

Name Description
DeleteLog() Deletes the log files if it exists
LogError(string message, params object[] args) Logs a message of type error
LogInfo(string message, params object[] args) Logs a message of type information
LogWarning(string message, params object[] args) Logs a message of type warning
OpenLog() Opens the existing log file
OpenLogFolder() Opens the parent folder of the log file
SetConnection(ConnectionDetail connectionDetail) Change the connection associated with the log manager