4. Logs

TrustView and the components around it each write their own logs. This page describes where to find them, how to get more detail in them, and how to send them to our Support.

Tip

Most problems with a single certificate, SSL endpoint, automation task or integration can be seen directly in TrustView, in the Event log on the detail page of the object, without opening any log file.

4.1. Overview

Component

Where the logs are (default)

Described in

TrustView

C:\Program Files\TrustView-Embedded\tomcat\logs

TrustView log file

Database performance (optional)

Same folder as the TrustView log file

Add database performance logging

Login events for a SIEM (optional)

Same folder as the TrustView log file

Sending login events to a SIEM

Scan agent

The agent’s console or service log

Scan agent logging

ADCS module

logs folder under Issue and Retrieve

ADCS module logs

Microsoft DNS integration

logs folder of the Microsoft DNS service

Microsoft DNS integration logs

simple-acme

C:\ProgramData\simple-acme

ACME client logs

Certbot

/var/log/letsencrypt/

ACME client logs

A single object in TrustView

Event log on the detail page of the object

Event log in TrustView

4.2. TrustView log file


Click here for detailed steps

There may be cases where you need the trustview-xxxx-xx-xx.log file for troubleshooting or we need it to provide support if we do not have direct access to the server for your TrustView installation.

The log file can typically be found in this location, depending on the TrustView directory name:

Typical location of the log files for the Embedded version of TrustView
 C:\Program Files\TrustView-Embedded\tomcat\logs

The log file can be opened with any text editor but Notepad++ can be recommended.

With the default logging configuration of the Embedded version, a new log file is started every day. If a day’s log grows beyond 30 MB, it is split into zipped files named trustview-xxxx-xx-xx.N.log.zip. Log files are kept for 60 days, and at most 500 MB in total, after which the oldest are deleted automatically.

The same folder also holds the log files of the TrustView Embedded Service itself (TrustView-Embedded-Service followed by .out.log, .err.log or .wrapper.log), which can be useful if TrustView does not start.

If you are still using the Standalone version of TrustView, the log files are located elsewhere:

Typical location of the log files for the Standalone version of TrustView
 C:\Program Files\Apache Software Foundation\Tomcat X.X_TrustView\logs\trustview-date

It is also possible to send specific log files directly from TrustView to our backend, instead of locating the log files manually.

Go to the Support section, found in the top right corner of TrustView.

Under Send log files to Technical support, you can select all the available log files that are relevant for the situation and then press Send to Technical support to send the selected log files securely to Cryptomathic, for analysis.

The list shows the .log, .txt and .zip files in TrustView’s logs folder that have changed within the last 30 days.

Note

It requires a user of the role Superuser or Global Administrator to be able to access this and send the log files.


4.3. Add database performance logging


Click here for detailed steps

Use the following step-by-step instructions if you need to monitor the performance of the database used by TrustView:

Locate the trustview.groovy file in the TrustView installation directory, typically:

Directory path to the Embedded TrustView configuration file
 C:\Program Files\TrustView-Embedded\tomcat\conf\trustview.groovy

Add and enable the generate_statistics setting to the file:

Example of enabling additional logging in the TrustView configuration file
1hibernate {
2    ...
3        generate_statistics = true
4    ...
5}

Important

If you are still using the Standalone version of TrustView, the configuration file is named TrustView.groovy and found here instead:

Directory path to the Standalone TrustView configuration file
 C:\Program Files\Apache Software Foundation\Tomcat X.X_TrustView\lib\TrustView.groovy

If you are using xml-based logging (logback.xml), then locate the file and add the following appender. On the Embedded version of TrustView it is typically found here:

Directory path of the logback.xml logging configuration file (Embedded version)
 C:\Program Files\TrustView-Embedded\tomcat\conf\logback.xml

Tip

If you are still using the Standalone version of TrustView, it is instead found at C:\Program Files\Apache Software Foundation\Tomcat X.X_TrustView\conf\logback.xml.

Example of how to add the appender in the logback.xml configuration file
 1<appender name="DB_PERFORMANCE" class="ch.qos.logback.core.rolling.RollingFileAppender">
 2    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
 3        <fileNamePattern>${LOG_ROOT}/trustview-db-%d{yyyy-MM-dd}.log</fileNamePattern>
 4    </rollingPolicy>
 5    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
 6        <fileNamePattern>${LOG_ROOT}/trustview-db-%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
 7        <maxFileSize>250MB</maxFileSize>
 8        <maxHistory>60</maxHistory>
 9        <totalSizeCap>500MB</totalSizeCap>
10    </rollingPolicy>
11    <encoder>
12        <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>
13    </encoder>
14</appender>

Add the following loggers to the logback.xml file as well:

Additional logging appender that should be added to the logback.xml configuration file
 1<logger name="org.hibernate.SQL" level="DEBUG" additivity="false">
 2    <appender-ref ref="DB_PERFORMANCE"/>
 3</logger>
 4<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" additivity="false">
 5    <appender-ref ref="DB_PERFORMANCE"/>
 6</logger>
 7<logger name="org.hibernate.engine.internal.StatisticalLoggingSessionEventListener" level="TRACE" additivity="false">
 8    <appender-ref ref="DB_PERFORMANCE"/>
 9</logger>
10<logger name="org.hibernate.stat.internal.ConcurrentStatisticsImpl" level="TRACE" additivity="false">
11    <appender-ref ref="DB_PERFORMANCE"/>
12</logger>

Finally, register the appender in the same file:

1<root level="INFO">
2    <appender-ref ref="STDOUT" />
3    <appender-ref ref="FILE" />
4    <appender-ref ref="DB_PERFORMANCE"/>
5</root>

Note

When using the logback.xml file, the Apache Tomcat Windows service does not need to be restarted. It is reloaded automatically shortly after the file is saved (Logback rescans it periodically, by default about once a minute). The logback.xml file only needs to be saved after the changes.

If you are using the groovy-based logback configuration (logback.groovy), locate the file and add the following. On the Embedded version of TrustView it is typically found here:

Example of how to add the appender in the logback.groovy configuration file (Embedded version)
1 C:\Program Files\TrustView-Embedded\tomcat\conf\logback.groovy

Tip

If you are still using the Standalone version of TrustView, it is instead found at C:\Program Files\Apache Software Foundation\Tomcat X.X_TrustView\conf\logback.groovy.

1appender("DB_PERFORMANCE", FileAppender) {
2    file = "${targetDir}/db-performance.log"
3    append = true
4    encoder(PatternLayoutEncoder) {
5        pattern = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
6    }
7}

Then add the loggers:

1logger("org.hibernate.SQL", DEBUG, ['STDOUT', 'DB_PERFORMANCE'], false)
2logger("org.hibernate.type.descriptor.sql.BasicBinder", TRACE, ['STDOUT', 'DB_PERFORMANCE'], false)
3logger("org.hibernate.engine.internal.StatisticalLoggingSessionEventListener", TRACE, ['STDOUT', 'DB_PERFORMANCE'], false)
4logger("org.hibernate.stat.internal.ConcurrentStatisticsImpl", TRACE, ['STDOUT', 'DB_PERFORMANCE'], false)

Finally, register the DB_PERFORMANCE appender:

1 root(INFO, ['FILE', 'DB_PERFORMANCE'])

Important

When using the groovy-based logback configuration (logback.groovy), the Apache Tomcat Windows service must be restarted after the changes have been completed and saved.


4.4. Additional logging for troubleshooting


Click here for detailed steps

Beyond the database performance example above, any part of TrustView can be logged in more detail the same way, by adding extra <logger> entries (or logger(...) lines, for logback.groovy) to the same logback.xml/logback.groovy file - no extra installation is required.

Important

A freshly installed Embedded version only ships with the STDOUT and FILE appenders enabled by default. Everything below is something you add on top of that default, not something already active out of the box.

Add a <logger> entry for the relevant class or package name, at the suggested level, for example:

Example of raising the log level for a specific class in logback.xml
1<logger name="certificate.management.tool.AgentConnectionController" level="INFO" additivity="false">
2    <appender-ref ref="FILE"/>
3</logger>

or, for logback.groovy:

1logger("certificate.management.tool.AgentConnectionController", INFO, ['FILE'], false)

The following classes and packages are useful starting points for specific troubleshooting scenarios:

  • Login/authentication issues (AD, SSO or local accounts) - org.springframework.security at TRACE, or more narrowly org.springframework.security.authentication.dao at TRACE for database/LDAP-backed logins specifically, and certificate.management.tool.LoginController at TRACE for the login flow itself.

  • Database transaction issues (beyond slow queries, which the performance logging above already covers) - org.hibernate.engine.transaction.internal.TransactionImpl at TRACE.

  • Monitored-object scanning in general (certificates, CRLs, domains and the other monitored object types all share this base class) - certificate.management.tool.AbstractMonitoredObjectService at TRACE.

  • SSL endpoint scan or handshake failures - certificate.management.ssl.scanner.testscripts.SslHandshakeTestScript at INFO.

  • AD-based SSL endpoint discovery failing (see also the related troubleshooting entry in Certificate Discovery) - certificate.management.ssl.scanner.ActiveDirectoryHostnameExtractionTestscriptService at INFO.

  • Automation agent connection or activation problems - certificate.management.tool.AgentConnectionController at INFO, and certificate.management.tool.AgentConnectionActivationTemplateService at TRACE.

  • ADCS connection or issuance problems - certificate.management.tool.api.AdcsConnectionController at TRACE.

  • SCEP enrollment issues for automation agents - org.jscep at DEBUG.

  • Scheduled scan or automation timing issues - org.quartz at TRACE.

  • Broad, whole-application debugging (noisy - use only as a last resort) - certificate.management.tool at DEBUG.

Note

As with the database performance example above, a change to logback.xml is picked up automatically shortly after the file is saved (by default within about a minute), without restarting the Embedded TrustView service; a change to logback.groovy requires a restart.

Tip

The trustview-scanagent component (an external Scan agent, see Scan Agents) uses a different, simpler mechanism for its own logging - see Scan agent logging below.


4.5. Shipping logs to an external logging system


Click here for detailed steps

TrustView’s logs can be delivered to an external logging or monitoring system in a few different ways, depending on what that system is and how it is normally fed.

The lowest-risk option, requiring no change to TrustView at all, is to point the external system’s own collection agent at the log file described under TrustView log file above and have it tail that file directly. This is how most log-management platforms are normally fed - for example Splunk’s Universal Forwarder, a Graylog Sidecar, or Filebeat for an Elastic/ELK stack - and it requires no restart and no change to logback.xml/logback.groovy.

To send only the login events to a SIEM, see Sending login events to a SIEM below.

Logback (which TrustView uses) includes a syslog appender as standard, so no extra installation is required. Add it to logback.xml:

Example syslog appender in logback.xml
 1<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
 2    <syslogHost>syslog.example.com</syslogHost>
 3    <port>514</port>
 4    <facility>LOCAL0</facility>
 5    <suffixPattern>TrustView: %logger{36} - %msg</suffixPattern>
 6</appender>
 7
 8<root level="INFO">
 9    <appender-ref ref="STDOUT" />
10    <appender-ref ref="FILE" />
11    <appender-ref ref="SYSLOG" />
12</root>

or, for logback.groovy:

1appender("SYSLOG", SyslogAppender) {
2    syslogHost = "syslog.example.com"
3    port = 514
4    facility = "LOCAL0"
5    suffixPattern = "TrustView: %logger{36} - %msg"
6}
7root(INFO, ['FILE', 'SYSLOG'])

Important

This built-in appender sends over plain UDP (RFC 3164) - it is not encrypted, and individual messages can be dropped under heavy load, which is normal for syslog. It is nonetheless the most broadly compatible option, since nearly every SIEM or log-management platform (Splunk, Graylog, a self-hosted ELK/Logstash stack via its syslog input, QRadar, etc.) accepts a syslog source.

A related but different use case - getting notified immediately when something goes wrong, rather than aggregating every log line - can be done with Logback’s built-in SMTP appender, which also needs no extra installation:

Example e-mail alert appender in logback.xml
 1<appender name="EMAIL_ALERT" class="ch.qos.logback.classic.net.SMTPAppender">
 2    <smtpHost>smtp.company.com</smtpHost>
 3    <to>oncall@company.com</to>
 4    <from>trustview@company.com</from>
 5    <subject>TrustView error: %logger{20} - %msg</subject>
 6    <layout class="ch.qos.logback.classic.PatternLayout">
 7        <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</pattern>
 8    </layout>
 9</appender>
10
11<root level="INFO">
12    <appender-ref ref="STDOUT" />
13    <appender-ref ref="FILE" />
14    <appender-ref ref="EMAIL_ALERT" />
15</root>

Note

By default, the SMTP appender only sends a mail when an ERROR-level (or higher) event occurs - lower-level events are buffered as surrounding context inside that same mail, rather than each triggering a mail of their own.

For structured, field-based ingestion - for example feeding Logstash/ELK directly as JSON, or Graylog’s native GELF format - Logback needs an additional, third-party encoder library, which is not bundled with TrustView and has not been tested by Cryptomathic. Adding one works the same way as adding a JDBC driver: place the library’s .jar file (and any of its own dependencies) in C:\Program Files\TrustView-Embedded\tomcat\lib and it is picked up automatically on the next start.

Important

This option is shown for reference only - contact our Support before adding a third-party logging library to a production installation.

As an example, the commonly used logstash-logback-encoder library adds a Logstash-specific appender:

Example - requires the logstash-logback-encoder library (not bundled)
1<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
2    <destination>logstash.example.com:5000</destination>
3    <encoder class="net.logstash.logback.encoder.LogstashEncoder" />
4</appender>

A Graylog-specific GELF appender (for example from a third-party GELF logging library) follows the same pattern, sending its own structured format instead of plain text.


Tip

The trustview-scanagent component (an external Scan agent, see Scan Agents) writes its own, separate log output and is not covered by the logback.xml/logback.groovy files described here - see Scan agent logging below.


4.6. Sending login events to a SIEM

Security teams often want TrustView’s login events in their SIEM, such as Splunk, Microsoft Sentinel or QRadar. TrustView writes these events to the TrustView log file, at the INFO level:

  • Successful logins, including logins with two-factor authentication

  • Failed logins, with the reason, for example a wrong password

  • Authentication with API keys

All of them come from the logger certificate.management.tool.AuthenticationEventListener, for example:

Examples of login events in the TrustView log file
 User jdoe logged in
 Username jdoe got - Bad credentials from ...

The login events can be sent to a SIEM with any of the methods under Shipping logs to an external logging system above. If the SIEM should only receive the login events, and not the rest of the TrustView log, write them to a separate log file as well, and point the SIEM’s collection agent at that file:


Click here for detailed steps

Add an appender for the separate log file and a logger for the login events to logback.xml, above the <root> element. On the Embedded version of TrustView, the file is typically found here:

C:\Program Files\TrustView-Embedded\tomcat\conf\logback.xml
Example of writing the login events to a separate trustview-audit log file
 1<appender name="AUDIT" class="ch.qos.logback.core.rolling.RollingFileAppender">
 2    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
 3        <fileNamePattern>${LOG_ROOT}/trustview-audit-%d{yyyy-MM-dd}.log</fileNamePattern>
 4        <maxHistory>90</maxHistory>
 5    </rollingPolicy>
 6    <encoder>
 7        <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
 8    </encoder>
 9</appender>
10
11<logger name="certificate.management.tool.AuthenticationEventListener" level="INFO" additivity="false">
12    <appender-ref ref="FILE"/>
13    <appender-ref ref="AUDIT"/>
14</logger>

The login events are then written both to the normal TrustView log file (FILE) and to trustview-audit-yyyy-mm-dd.log in the same folder, which is kept for 90 days. The pattern is kept simple, without colour codes, so it is easy for a SIEM to parse.

Note

The change to logback.xml is picked up automatically shortly after the file is saved, without restarting TrustView.

If you are using the groovy-based logback configuration (logback.groovy), add the following instead:

 1appender("AUDIT", RollingFileAppender) {
 2    rollingPolicy(TimeBasedRollingPolicy) {
 3        fileNamePattern = "${targetDir}/trustview-audit-%d{yyyy-MM-dd}.log"
 4        maxHistory = 90
 5    }
 6    encoder(PatternLayoutEncoder) {
 7        pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"
 8    }
 9}
10
11logger("certificate.management.tool.AuthenticationEventListener", INFO, ['FILE', 'AUDIT'], false)

Important

When using logback.groovy, the TrustView service must be restarted after the changes have been saved.

Point the SIEM’s collection agent at the new trustview-audit-*.log files. As an example, with Splunk’s Universal Forwarder installed on the TrustView server, add a monitor to its inputs.conf:

Example of a Splunk Universal Forwarder input for the TrustView login events
1[monitor://C:\Program Files\TrustView-Embedded\tomcat\logs\trustview-audit-*.log]
2sourcetype = trustview:audit
3index = security
4disabled = false

Change index to the index your security team uses. Other SIEMs work the same way with their own agent, for example the Azure Monitor Agent for Microsoft Sentinel, or Elastic Agent. Alternatively, add a SYSLOG appender (see Shipping logs to an external logging system) to the logger instead of, or as well as, AUDIT.

Tip

Other events, such as orders, issued and revoked certificates and certificate checkouts, are shown in the Event log of each object in TrustView. To get an e-mail every time a user logs in, see Get an e-mail notification on every login.


4.7. Scan agent logging

The external Scan agent writes its own, separate log output to its console/service log - it does not use TrustView’s own logback.xml/logback.groovy files described under Additional logging for troubleshooting above, since it runs as its own process.

Its log level can be raised in two ways, without editing the agent’s own packaged configuration file:

  • Set the root.level (and, for the scheduler specifically, quartz.level) system property when starting the agent, for example DEBUG instead of the default INFO.

  • Drop a logconfig.xml file next to the agent’s own configuration file - if present, it is automatically included and can define additional loggers/appenders the same way as described for the main TrustView application.

4.8. ADCS module logs

The Issue and Retrieve services of the ADCS module each write their own log files, in a logs folder next to the service, for example:

Default location of the ADCS module log files
 C:\Program Files\TrustView-ADCS\Issue\logs
 C:\Program Files\TrustView-ADCS\Retrieve\logs

By default, the log files are named after the service, for example TrustView-ADCS-Issue-Service, followed by .out.log (the output of the service), .err.log (errors) or .wrapper.log (starting and stopping the service). A log file is rolled over at 10 MB, and up to 8 files are kept.

The ADCS module logs at the info level by default. To get more detail, for example to see which CAs and templates are found, raise the log level:

  1. Open TrustView-ADCS-Issue-Service.xml (or TrustView-ADCS-Retrieve-Service.xml) in the folder of the service.

  2. In the <arguments> line, change -loglevel info to -loglevel debug, or to -loglevel trace for the most detail.

  3. Save the file and restart the TrustView ADCS Issue Service (or TrustView ADCS Retrieve Service) Windows service.

Example of the arguments line with debug logging enabled
 <arguments>-ExecutionPolicy Bypass -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -File "%BASE%\pkiissue.ps1" -loglevel debug</arguments>

Important

Set the log level back to info when you are done troubleshooting, as debug and especially trace produce a lot of output.

What TrustView itself logs about the communication with the ADCS module can be raised separately, see Additional logging for troubleshooting above. For troubleshooting the connection to the CA itself, see the Troubleshooting section of ADCS.

4.9. Microsoft DNS integration logs

The Microsoft DNS service used by the DNS integration writes its log files in a logs folder in the folder the service was installed from, named TrustView-MS-DNS-Service followed by .out.log, .err.log or .wrapper.log.

To get more detail, change -loglevel info to -loglevel debug in the <arguments> line of TrustView-MS-DNS-Service.xml, and restart the TrustView MS DNS Service Windows service.

4.10. ACME client logs (simple-acme and Certbot)

For simple-acme, the logs can be located by default here:

C:\ProgramData\simple-acme

It is also possible to set up custom logging for simple-acme, see simple-acme custom logging.

For Certbot, the logs can be located by default here:

/var/log/letsencrypt/

The ACME clients run on the server where the certificate is installed, not on the TrustView server, so their logs are found there. See Automation for how the clients are set up.

4.11. Event log in TrustView

Most objects in TrustView have their own Event log at the bottom of their detail page - for example certificates, SSL endpoints, automation tasks, agent connections, DNS providers and CT monitored domains. It lists what has happened to that object, with a Timestamp, the Event, the User who caused it and the Details.

The event log is often the quickest place to look, for example to see why an order, a renewal, a revocation or an automation task failed, before looking in the log files on the server.

4.12. Which log should I check?

  • TrustView does not start, or an update failed - the TrustView log file and the log files of the TrustView Embedded Service in the same folder.

  • Login problems (AD, SSO or local users) - the TrustView log file, with more detail as described under Additional logging for troubleshooting.

  • Notifications are not received - the TrustView log file, see also the troubleshooting section of Notifications.

  • ADCS certificates are not issued, imported or revoked - the ADCS module logs first, then the TrustView log file.

  • Scans do not find what they should - the Scan agent logs if an external scan agent is used, otherwise the TrustView log file.

  • Automated renewal or installation of a certificate fails - the Event log of the automation task, then the ACME client logs on the server where the certificate is installed.

  • Let’s Encrypt DNS validation through Microsoft DNS fails - the Microsoft DNS integration logs.

  • A single certificate order or object behaves unexpectedly - the Event log on its detail page.

If you contact our Support, include the relevant log files from around the time the problem occurred, or send them directly from TrustView.