We just ran into an issue where it turned out that the custom log directory that we set using Report.LogFileName does not exist. In this case, you get a really strange exception:
Error: Could not create writer (many instances running?)
Stacktrace:
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.CreateLogFileWriter(String fileName, Int32 cnt)
at Aardvark.Base.Report.<>c.<.cctor>b__13_1(Int32 firstThreadIndex, LogType firstType, Int32 firstLevel, String firstMessage)
at Aardvark.Base.TextLogTarget.Log(LogMsg msg)
at Aardvark.Base.TextLogTarget.Log(Int32 threadIndex, LogMsg msg)
at Aardvark.Base.MultiLogTarget.Log(Int32 threadIndex, LogMsg msg)
at Aardvark.Base.JobReporter.Line(LogType type, Int32 level, ILogTarget target, String t0, Int32 p1, String t1)
at Aardvark.Base.Report.Line(String line, Object[] args)
at ZG.Hilite.Plugin.util.PluginLogger.Info(String pMsg, Object pComponent) in C:\- Work\pCon.Hilite.Sports\src\ZG.Hilite.Plugin\util\PluginLogger.cs:line 68
I now checked this in other applications and there "of course" have Directory.Exists checks. However, I think it would be much more convenient if this happens behind the scene, otherwise, we should make sure the error message is more helpful. Please have a look at this :-)
We just ran into an issue where it turned out that the custom log directory that we set using
Report.LogFileName
does not exist. In this case, you get a really strange exception:I now checked this in other applications and there "of course" have
Directory.Exists
checks. However, I think it would be much more convenient if this happens behind the scene, otherwise, we should make sure the error message is more helpful. Please have a look at this :-)