Logging
primedocs logs with NLog. Every server application and every component of primedocs Desktop writes its own log files. Warnings and errors of the server applications can additionally be written centrally to the operation database. This page describes what is logged where and how logging is configured. How to collect the files for a support request is shown in Server Logs and Client Logs.
Overview
| Source | Location | File | Logged levels | Timestamps |
|---|---|---|---|---|
| Server applications | Installation folder of the respective application | serverApp.oolog | Info and above | UTC |
| Server applications, optional | Operation database, table NLog | — | Warn and above | UTC |
| primedocs Desktop | Log folder of the user, see Setting the log folder | PrimeDocs.Client.txt | all | Local time |
| Office COM add-ins | Same folder as primedocs Desktop | PrimeDocs.AddIn.*.txt | all | Local time |
Connect calls appear in the log of the processing component, i.e. the Connect service, the Web API or primedocs Desktop. primedocs Desktop can additionally record the Connect calls it receives, see Connect log and Connect Logs. Which templates are used is not recorded in the technical log but in the usage log in the database.
Server applications
Each server application has its own NLog.config in its installation folder and writes the file serverApp.oolog next to it.
- Rotation: A new file is started every day. Earlier days are kept as
serverApp.<n>.oolog, the lowest number being the most recent day. At most seven archived files are kept, older ones are deleted. - Levels: The file receives messages of the levels Info, Warn, Error and Fatal. Messages from Microsoft components (ASP.NET Core, Entity Framework Core) only appear from Warn upwards.
- Line format: Timestamp in UTC, machine name, level, message and, where applicable, the full exception.
Server log timestamps are in UTC, client log timestamps in local time. Take the time difference into account when matching server and client logs (in Switzerland one hour in winter, two hours in summer).
Applications and log folders
So that the DataSourceAdminApp can display the files and download them as a ZIP, each application under apps in the primedocs.config carries the attribute logFilePath. A relative path refers to the folder of the primedocs.config. The attribute only defines where the files are read from. Where they are written is determined by the NLog.config of the application.
Application (type) | Purpose | logFilePath (default) | Value in the Application column |
|---|---|---|---|
App | primedocs Web, Office web add-ins | App\ | Client |
AdminApp | Web Admin | Admin\ | AdminApp |
WebApi | Web API, including Admin API and Connect API | WebApi\ | WebApi |
Service | Synchronisation of primedocs Desktop | Service\ | Service |
IdentityServer | Sign-in | IdS\ | IdS |
AddressService | Server-side Address Providers | AddressService\ | AddressService |
Connect | Connect service (/api/v1/Connect) | Connect\ | Connect |
Mcp | MCP server | Mcp\ | Mcp |
JobHost | User synchronisation and background jobs | JobHost\ | JobHost |
DataSourceAdminApp | Admin Dashboard | DataSourceAdminApp\ | never writes to the database |
HealthMonitor | Health Monitor | HealthMonitor\ | never writes to the database |
The IdentityServer for Windows authentication, if installed, also writes a serverApp.oolog to its installation folder and appears in the database as IdSAuth. On Azure, the JobHost runs as a WebJob from a temporary copy. Its log file is therefore not located in the JobHost\ folder there, but its warnings and errors can be evaluated through logging to the database.
Changing log location and level
Location, retention and levels can be changed in the NLog.config of the respective application, for example a different minlevel in the rule for the file target to temporarily write Debug messages as well. The syntax is described in the NLog documentation.
- Different location: In the
filetarget, replace${basedir}with the desired folder and updatelogFilePathin theprimedocs.configaccordingly. Each application needs its own folder. Keep the.oologfile extension, because the Admin Dashboard only shows and downloads*.oologfiles. The procedure for a read-only application directory is described in Read-only application directory. - Updates: The update script compares each
NLog.configwith the version in the update package and, if they differ, asks whether to replace or keep the file, see Update primedocs server.
Verbose levels such as Debug or Trace produce large files and can log content from documents and data sources. Only enable them for troubleshooting and reset them afterwards.
Logging to the database
If databaseLoggingEnabled="true" is set on the root element of the primedocs.config, the server applications additionally write warnings, errors and fatal errors to the NLog table of the operation database (operationDbConnectionString). The log files are still written. DataSourceAdminApp and Health Monitor never write to the database.
<primedocs operationDbConnectionString="..."
databaseLoggingEnabled="true">
...
</primedocs>
Each entry contains machine name, application (column Application, see table above), time in UTC, level, message, logger, call site and exception. This requires the Database target to be present unchanged in the NLog.config.
The entries are evaluated in two places:
- Admin Dashboard: The LOGGING tab on the start page only appears when database logging is enabled. It shows the latest 1000 entries, filters for the Error level (Show only Errors), marks individual entries as read (Mark as Read) and deletes all entries (Delete All Logs).
- Health Monitor: Unread entries of the levels Warn and Error from the last 24 hours are included in the status. Entries marked as read no longer count, see Application Log.
Retention
On every run without parameters, the JobHost deletes all entries of the NLog table that are older than 14 days, provided database logging is enabled. The cleanup can be started on its own with primedocs.JobHost.exe RemoveOldLogEntries. The period is fixed and cannot be configured.
primedocs Desktop and Office COM add-ins
primedocs Desktop and the Office COM add-ins write to a shared log folder per user. There is one file per component:
| File | Component |
|---|---|
PrimeDocs.Client.txt | primedocs Desktop, including client-side Connect processing |
PrimeDocs.AddIn.Word.txt | Word add-in for classic templates |
PrimeDocs.AddIn.Common.Word.txt | Word add-in for the new template types and Snippets |
PrimeDocs.AddIn.Common.Excel.txt | Excel add-in |
PrimeDocs.AddIn.Common.PowerPoint.txt | PowerPoint add-in |
PrimeDocs.AddIn.Outlook.txt | Outlook add-in |
- Rotation: As on the server, one file per day with at most seven archived files (
PrimeDocs.Client.<n>.txtetc.). - Levels: Everything is logged, including Trace and Debug.
- Line format: Timestamp in local time, logger, Windows user, machine name, process ID and message. The add-ins for the new template types also write the level.
- Opening: In primedocs Desktop under primedocs › Help › Open log directory, see Client Logs.
Setting the log folder
The log folder is set during installation, see Client Installation:
- Interactive installation: The log folder follows the cache folder chosen in the installation dialog. With the preselected Local directory it is
%LOCALAPPDATA%\primedocs\Logs, with Roaming directory%APPDATA%\primedocs\Logsand with Custom<cache folder>\primedocs\Logs. - Installation without dialogs: The MSI property
LOGFOLDERdetermines the folder. It accepts NLog placeholders such as${specialfolder:LocalApplicationData}. Without it,${specialfolder:ApplicationData}/primedocs/Logsapplies, i.e.%APPDATA%\primedocs\Logs. - Update: The installer takes the folder from the
NLog.configof primedocs Desktop and writes it to the configuration of primedocs Desktop and all Office COM add-ins. ALOGFOLDERpassed during the update is not taken into account.
Connect log
To analyse Connect calls, primedocs Desktop can save every Connect call it receives as a separate file. The recording is switched on under primedocs › Options › primedocs Connect with Enable logging and ends automatically 24 hours after activation for data protection reasons.
- Location:
%TEMP%\primedocsConnectLogger, one file per call, named after the time in UTC (yyyyMMdd_HHmmss_fff.txt). - Content: The received Connect XML. It can contain personal data.
- Opening: With Open Connect log folder in the same area.