Logging All AMI Events

Nov 24, 2014 at 8:04 AM
Hey Ben Merrills a.k.a Skrusty,

Is there a way we can log all AMI events into a .txt file? For troubleshooting etc etc like log4net or any other open source.

Nov 24, 2014 at 8:40 AM
Yeah, AsterNET (and this is legacy from Asterisk.NET) writes by default to Debug. You can hook into this and write it to a log file. Take a look in the discussions, someone else raised this and a code sample was provided to show how to write to a file. (Can't off the top of my head remember how)
Nov 24, 2014 at 9:33 AM
Okay, btw I messaged you, see your inbox.
Nov 24, 2014 at 10:05 AM
replied! :)
Nov 24, 2014 at 10:22 AM
Edited Nov 24, 2014 at 11:23 AM
searched through all the discussions unable to find, anyway I'll try to edit sources myself.
Nov 24, 2014 at 4:28 PM
I've not tried this myself yet, but you could turn on debugging to show any debug output from AsterNET. 

Add the following to your app,conf 

<trace autoflush="false" indentsize="4"> 
<add name="EventLogListener" type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="c:\asternet.svclog" />

This will create a log file in the path above, of course it might be very large depending on how busy your server is.
Nov 25, 2014 at 7:40 AM
Blimey! Its working ;)