Skip to content

Common Services

Michael Parsons (CWD) edited this page Apr 26, 2019 · 4 revisions

Services

Logging

The applications include methods for logging traces, errors, and emails. The config files have following keys

Key Name Notes

Section for tracing and logging

The utilities project has code for tracing, logging errors, and saving files (example files downloaded from registry). The same approach is used in the finder project.

The default folder for logs is c:\@logs. Create the latter folder and give modify access as needed for your environment, or just select Everyone.

appTraceLevel

Set to the max level of tracing to display. The DoTrace methods start with a display level. The actual method that outputs trace messages to a file (and console) will only output message with a display level less than or equal to the value of appTraceLevel.

LoggingHelper.DoTrace( 8,”some message to only show in rare circumstances” );

Or for messages to always log.

LoggingHelper.DoTrace( 1, string.Format( " - Updates since: {0} ", startingDate ) );

path.error.log

Path and filename for file to store error messages. Uses a pattern so only a month of files are kept, and then overwritten.

C:\@logs\[date]_FinderImport_ErrorLog.txt

path.trace.log

Path and filename for file to store trace messages. Uses a pattern so only a month of files are kept, and then overwritten.

C:\@logs\[date]_FinderImport_TraceLog.txt

path.log.file

Path and pattern for saving files such as registry downloads.

C:\@logs\RegistryDownload\[date]_[filename].json

If using the latter default value, be sure to create the RegistryDownload folder in the C:\@logs folder.

path.email.log

Path to file for logging emails, if logAllEmail=yes

Email

The project includes methods for sending email. This is configurable and is disabled by default. There are not many scenarios where emails are sent.
Copies of email will be saved in the email log if anyone is interested in the content.

Next: Databases

Clone this wiki locally