# Logging ```{toctree} :glob: :hidden: logging/* ``` powerJobs Processor uses [Apache log4net](https://logging.apache.org/log4net/) as core logging library, and additionally [PostSharp Diagnostics](http://doc.postsharp.net/5.0/logging) for extended Debug logging.\ By default, all the logs are stored in a logfile located in *'C:\\Users\\\{USER}\\AppData\\Local\\coolOrange\\powerJobs Processor\\Logs\\powerJobs Processor.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\\powerJobs Processor\\powerJobs Processor.log4net.\ Further information about log4Net Configurations can be found [here](https://logging.apache.org/log4net/release/manual/configuration.html).\ You can change the logging behaviour of: - the powerJobs Processor Application with the TraceWindow: [powerJobs.exe](#powerjobs-exe) - the powerJobs Processor Addin in the [JobProcessor](#jobprocessor-addin) - the powerJobs [Settings Dialog](#settings-dialog) - the [powerShell IDE](#powershell-ide) ## When to change the logging behavior? When you have issues or when you want to get a more detailed knowledge about what powerJobs Processor or powerVault cmdlets are doing, you can increase the [](/logging/log_level). ```{note} When changing the loglevel to DEBUG [PostSharp Diagnostics](http://doc.postsharp.net/5.0/logging) 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. ## powerJobs.exe If you need to get more details of errors that happen in the powerJobs Processor application, this is the right place to change the loglevel.\ Following section is used to control the logging behaviour for the powerJobs.exe: ```{code-block} xml :lineno-start: 73 :linenos: ``` Following *LogAppender* is used: ### LogFile This is the main *LogAppender* used in all the loggers. If you want to change the [](/logging/log_level) in the logfile, please visit following appender: ```{code-block} xml :lineno-start: 3 :linenos: ``` In the line ```{code-block} xml :lineno-start: 5 :linenos: ``` you can configure the outputpath and name of the logfile. Since this appender has no configured *LevelRangeFilter*, it's loggingLevel has to be configured on the loggers.\ In the lines ```{code-block} xml :lineno-start: 68 :linenos: ``` you can configure the logginglevel. You could set the level to "DEBUG", than all the levels between the range Debug and Fatal will be logged. ## JobProcessor Addin By default the Autodesk JobProcessor creates logfiles located in the *'C:\\Users\\\{USER}\\AppData\\Roaming\\Autodesk\\Autodesk Vault Job Processor'* directory when jobs are processed.\ Its [verbosity can be increased](https://knowledge.autodesk.com/support/vault-products/learn-explore/caas/sfdcarticles/sfdcarticles/Enabling-Advanced-Logging-in-the-Vault-Job-Processor.html) by modifying the configuration file in C:\\Program Files\\Autodesk\\Vault …\\Explorer\\JobProcessor.exe.config. In order to increase the [](/logging/log_level) for your custom Jobs, however the following section can be used to control the logging behaviour for the *JobHandler*: ```{code-block} xml :lineno-start: 75 :linenos: ``` powerJobs Processor provides it's own [PSHost](/jobprocessor/code_reference/objects/host), for which the logging can be configured in the section: ```{code-block} xml :lineno-start: 78 :linenos: ``` Following sections are used to control the logging behaviour for the powerJobs- and powerVault-Cmdlets: ```{code-block} xml :lineno-start: 81 :linenos: ``` In addition to the [LogFiles](#logfile) generated by powerJobs Processor the following *LogAppender* is available: ### Trace Window If you want to change the logging level or format of the logs that are displayed in the [Trace Window]() please visit the *MsgSenderAppender* which is only used from the JobProcessor extension: ```{code-block} xml :lineno-start: 23 :linenos: ``` In the following lines you see the Range Filter which is currently used. By changing the minimum level to DEBUG it would log debugging information to the Trace Window. ```{code-block} xml :lineno-start: 28 :linenos: ``` By changing the conversion pattern you change how the message looks like. ```{code-block} xml :lineno-start: 25 :linenos: ``` ## Settings Dialog Following section is used to control the logging behaviour for the [powerJobs Settings Dialog](): ```{code-block} xml :lineno-start: 87 :linenos: ``` Only the [LogFile](#logfile) appender is used. ## PowerShell IDE When debugging or creating jobs in powerShell IDEs, the same logging as the JobProcessor log window is logged into the powerShell *Console Window*.\ For that the [powerJobs- and powerVault-Cmdlets](#jobprocessor-addin) loggers are getting used.\ In order to customize the logging level in the console window, visit following appender: ### ColoredConsoleAppender *ColoredConsoleAppenders* are working for powerShell IDE's that support console windows. ```{code-block} xml :lineno-start: 35 :linenos: ``` In the lines ```{code-block} xml :lineno-start: 61 :linenos: ``` you can configure the required [](/logging/log_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: ```{code-block} xml :lineno-start: 36 :linenos: ``` ```{note} However the **powerShell ISE** currently does not support [console logs](#coloredconsoleappender) at all.\ When powerVault cmdlet's are getting used before importing the powerJobs Module, not all the powerVault logging can be redirected to the logger configured in the according section of the [JobProcessor addin](#jobprocessor-addin) ```