1

Hello could you help me with this problem:

Loggly I'm using C #, and I want to make a simple log, I found something similar to this:

var logger = new Logger("KEY", "logs-01.loggly.com");
logger.Log("Hello World¡¡¡");

but does not work, the relevant documentation is here:

Link Loggly Documentation

Help me please, thanks =)

Christian
  • 117
  • 1
  • 12

2 Answers2

0

Code that you provided works fine. Make sure that you use correct inputKey.

It should be just Customer Token or token plus some extra tags. For example:

var logger = new Logger("********-****-****-****-************/tag/tag1,tag2,tag3", "your-application-name");
logger.LogWarning("Hello World !!!");

You can use a packet capture tool like Fiddler to make sure events are being sent to Loggly successfully. You should see outbound events to logs-01.loggly.com on port 80.

0

Try enable ThrowExceptions

#if DEBUG
    LogglyConfig.Instance.ThrowExceptions = true;
#endif

This will cause Loggly to throw an exception instead of silently fail. You may want logging to silently fail in production rather than break your app.

In my case the exception message wasn't very helpful, but it did spot that I was adding a tag with a null value. The tag was optional, but if you try to create one with a value of null, the log will not get transmitted.

Andy Joiner
  • 5,932
  • 3
  • 45
  • 72