You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably I'm missing something obvious but I can't get Cleanroom to log any of my messages to the logfile. I set up a RotatingLogFileConfiguration and call enable in my AppDelegate, as show by the code below:
var configurations: [BasicLogConfiguration] = [basicLogConfig]
if let directoryPath = self.logFileDirectoryPath() {
let logConfiguration = RotatingLogFileConfiguration(minimumSeverity: .debug,
daysToKeep: 15,
directoryPath: directoryPath.path,
formatters: [formatter])
do {
logConfiguration.createLogDirectory()
configurations.append(logConfiguration)
} catch { }
}
Log.enable(configuration: configurations)
The file is correctly created in the directory passed by logFileDirectoryPath(), but the file is always empty no matter what...any thoughts?
The text was updated successfully, but these errors were encountered:
gdimaggio
changed the title
Not print to log file
Not printing logs to logfile
Mar 14, 2017
There could be multiple possibilities. Would you mind trying the just-issued 5.0.3 release first? It addresses a separate issue with logs not being flushed frequently enough when not running in synchronous mode. This is one possible cause of the behavior you're seeing.
Another thing to try it setting a couple breakpoints to make sure they're being hit. Setting one at RotatingLogFileRecorder.swift:136 will let you know if the rotating log recorder is being called.
Setting one at FileLogRecorder.swift:84 will let you know if the underlying log recorder used by the rotating recorder is being called.
Lastly, what do your Log statements look like? It is possible you're not recording anything at the .debug severity or higher?
I had a similar issue and it turned out that I was calling Log.enable() twice. Once by calling Log.enable(minimumSeverity: .debug) and once by calling Log.enable(configuration: [LogConfiguration]). I didn't realize that when enabling using configurations, you need to pass the severity directly in the LogConfiguration object.
Probably I'm missing something obvious but I can't get Cleanroom to log any of my messages to the logfile. I set up a RotatingLogFileConfiguration and call enable in my AppDelegate, as show by the code below:
The file is correctly created in the directory passed by
logFileDirectoryPath()
, but the file is always empty no matter what...any thoughts?The text was updated successfully, but these errors were encountered: