Jesse Sierks
Jesse Sierks

Reputation: 2397

CKFinder NLog Isn't Logging

I am using CKFinder in ASP.NET. It has been working but has recently stopped (uploads specifically). While trying to track down the issues, I noticed no logs are being written.

In my web.config, I have enabled verbose logging for ckfinder:

enableVerboseLogging="true"

Here is my NLog.config file (which I am not familiar with; we use log4net). Other traces are being written via NLog, however, so I think this is correct.

<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <targets async="true">
    <target xsi:type="File" name="logFile" fileName="${basedir}/App_Data/logs/ckfinder.log"
            archiveFileName="${basedir}/App_Data/logs/archives/ckfinder.{#}.log" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="5" concurrentWrites="true" keepFileOpen="false"
            layout="${level} | ${logger} | ${longdate} | ${message}${onexception: | ${exception:format=ToString,StackTrace:maxInnerExceptionLevel=10}}" />
  </targets>
  <rules>
    <logger name="*" minlevel="Trace" writeTo="logfile" />
  </rules>
</nlog>

Upvotes: 0

Views: 91

Answers (1)

Jesse Sierks
Jesse Sierks

Reputation: 2397

I was forgetting this line from Startup.Configuration:

LoggerManager.LoggerAdapterFactory = new NLogLoggerAdapterFactory();

Upvotes: 1

Related Questions