0

The target platform for this application is OSX. I've tried using different versions of NLog to get this working, but I'm not having any luck. The console and debugger targets work fine, but I can't get any other targets to work (e.g., file, eventlog, etc.). My file target is pretty simple:

<target name="file" xsi:type="File" layout="${logFormat}" fileName="${basedir}/logs/${shortdate}.log" />

There's no exception being thrown, but no log file is being created. My hope is that I'm just missing something pretty simple. Any help would be greatly appreciated!

Thanks.

Jon

GS-Scooter
  • 71
  • 6

1 Answers1

1

Turns out ${basedir} was pointing to a location that I wasn't expecting (Contents folder within the app package). File logging is indeed working like a charm.

GS-Scooter
  • 71
  • 6
  • How did you figure out what path it was outputting to? Trying to diagnose a similar problem in Xamarin iOS – Calvin Fisher Jan 12 '16 at 19:19
  • As it's been a while, I don't recall exactly what I did, especially since I haven't gone back to Xamarin for some time. That said, you might be able to drill down the configuration properties to get the path (see http://stackoverflow.com/questions/7332393/how-can-i-query-the-path-to-an-nlog-log-file). – GS-Scooter Jan 15 '16 at 17:31
  • If anyone else comes along after, I ended up just doing code configuration instead of XML configuration, and using SpecialFolder.MyDocuments to put the log files in a well known location. – Calvin Fisher Jan 16 '16 at 19:55