External Audit Logging Configuration

Pleasant Password Server creates an audit trail of all interactions between users and Pleasant Password Server. These logs are available in the "Logging" tab, which can be accessed by admins only (by default).

Log Location

By default, the logs are stored in the Pleasant Password Server database. The audit log file is found:

Version 7

  • C:\Program Files (x86)\Pleasant Solutions\Pleasant Password Server\www\web.nlog

Version 6

  • C:\Program Files (x86)\Pleasant Solutions\Pleasant Password Server\www\Web.config

Modifying Log Configuration

However, it is possible to modify the log configuration.

WARNING: Changes to the nlog or Config files will not be retained through upgrades!

If you have significantly modified these files it is recommend you back
them up before upgrading and check the newly installed files for updates
before reapplying your changes.

Redirecting the Audit events elsewhere, is possible, since all audit events are handled by an NLog logger.

  • To redirect the logs, add an NLog target and add it to the "WriteTo" list of the "PasswordServerAudit" logger.

Example 1:

To log all Audit events to a file, locate the NLog section of your config file and change it similar to this:

<nlog 
    xmlns="http://www.nlog-project.org/schemas/NLog.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
      <target name="rollingFile" xsi:type="File" layout="${longdate} ${logger} ${message} ${exception:format=tostring}"  fileName="C:/Temp/PleasantPasswordServerLog.txt" archiveFileName="C:/Temp/log.{#}.txt"              archiveEvery="Day" archiveNumbering="Rolling"              maxArchiveFiles="10"              archiveAboveSize="26214400"              concurrentWrites="true"              keepFileOpen="false"              encoding="utf-8" /> 
      <!-- Password Server Auditing Logs 
      <target name="auditFile"
              xsi:type="File"
              layout="${longdate} ${logger} ${message} ${exception:format=tostring}"
              fileName="C:/Temp/PleasantPasswordServerAudit.txt"
              archiveFileName="C:/Temp/PleasantPasswordServerAudit.{#}.txt"                             archiveEvery="Day"
              archiveNumbering="Rolling"
              maxArchiveFiles="10"
             archiveAboveSize="26214400"
             concurrentWrites="true"
            keepFileOpen="false"encoding="utf-8" />
    </targets>

    <rules>
      <logger name="PassMan.*" minLevel="Trace" writeTo="rollingFile" />
      <logger name="PasswordServerAudit" minLevel="Info" writeTo="auditFile" />
    </rules>
  </nlog>

Example 2:

To email a summary log to an email account, do something similar to this:

 <target xsi:type="BufferingWrapper"
          name="Mail"
          slidingTimeout="false"
          flushTimeout="86400000">
      <target name="gmail" xsi:type="mail"
                 subject="audit log ${longdate}"
                 layout="${longdate} ${logger} ${message} ${exception:format=tostring}"
                 smtpServer="smtp.gmail.com"
                 smtpPort="587"
                 smtpAuthentication="Basic"
                 smtpUserName="example@gmail.com"
                 smtpPassword="password"
                 enableSsl="true"
                 from="example@gmail.com"
                 to="example@gmail.com"
          />
</target>

...

<logger name="PasswordServerAudit" minLevel="Info" writeTo="gmail" />

  • This config section will ouput a file called "PleasantPasswordServerAudit.txt" to the C:\temp folder.
  • The example above uses Gmail, but it's possible to use any SMTP server.

 

For all of the possible mail configurations, check the nlog documentation:

 

For additional configuration options, see the Nlog wiki at:

Tag page
You must login to post a comment.