|
Hello,
I'm experimenting with NLog and have been successful with other log types but am not having much luck with Chainsaw based logging.
Any help would be greatly appreciated.
Background:
1) All communication is occurring over localhost on my dev box (I've disabled the firewall anyway)
2) I originally tried the type NLogViewer combined with Sentinal but had no luck (raw packet captures showed that the packets being sent had no data payloads.)
I can shoot over pcap logs upon request.
Chainsaw's output is as follows:
-----------------------------
Level INFO
Logger org.apache.log4j.chainsaw.messages.MessageCenter
Time 2012-02-21 20:26:35,024
Thread Chainsaw-WorkerThread
Message Connection lost! :: invalid stream header: 3C6C6F67
NDC null
Class ?
Method
Line
File
Properties {{hostname,chainsaw}{log4jid,70}{application,log}}
Throwable
-----------------------------
I have NLog setup to write to the internal log file and am seeing the following entry:
-----------------------------
2012-02-21 20:19:02.4956 Error Error when sending System.IO.IOException: Error: ConnectionRefused
-----------------------------
My NLog.config contains the following:
-----------------------------
<targets async="true"> <target name="chainSaw"
xsi:type="Chainsaw"
address="TCP://127.0.0.1:4560"
includeCallSite="true"
includeSourceInfo="true"
appInfo="NLogTestApp"/> </targets> <rules> <logger name="*" minlevel="Trace" writeTo="chainSaw" /> </rules> -----------------------------
My test application is as follows:
-----------------------------
class NLogTests
{
public static void Main()
{
Logger logger = LogManager.GetCurrentClassLogger();
LogEventInfo myEvent = new LogEventInfo(LogLevel.Debug, "", "My debug message");
myEvent.LoggerName = logger.Name;
myEvent.Properties.Add("MyCustomValue", "This is from MyClass");
//The perils of listening to Cake while coding
logger.Error("The roof, The roof, The roof is on fire");
logger.Fatal("We Don't Need No Water Let The MF Burn");
Console.Out.Flush();
for (int i = 0; i < 10; i++)
{
//Hmmm still no good . . .
//Lets keep the main thread going before we dump out
Console.WriteLine("Sleeping " + i);
Thread.Sleep(500);
}
Console.ReadKey();
}
-----------------------------
Thank you!
- Jordan
|