Skip to content

How to use a fallback when it cannot send data to CloudWatch #283

Answered by ashishdhingra
thewinner55 asked this question in Q&A
Discussion options

You must be logged in to vote

@thewinner55 Thanks for starting discussion. I see some problem in your code. You are defining static method LogMessageAsync(), but your constructor is not static, which means it only executes when you create an instance of your custom CloudWatchLogger class.

Also note that in NLog.AWS.Logger.AWSTarget class, it:

  • Exposes LibraryLogErrors (default value true) and LibraryLogFileName (default value aws-logger-errors.txt)
  • These properties are used when there is an issue sending logs (e.g. due to AWS credentials not configured)
  • Delegate AwsLogLibraryAlert is also set, which calls NLog's InternalLogger.Error().
    • To use NLog's InternalLogger, properties InternalLogger.LogFile and InternalLogger…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ashishdhingra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants