Coder Social home page Coder Social logo

Comments (8)

ashishdhingra avatar ashishdhingra commented on August 24, 2024

Hi @GSFAtArrow,

Good afternoon.

Thanks for opening the issue? Could you please share the below:

  • What is the type of application (or the Visual Studio template used)? Is it .NET Framework Web API project?
    • Is possible, please share the sample code solution (you may ZIP it and attach it to this issue) for faster troubleshotting. Also share the deployment/execution steps.
  • How are you executing the application?
    • Are you executing from Visual Studio debugger? OR
    • Are you deploying to IIS and then executing the application?
  • Where is the application deployed? If it on the standalone box or an EC2 instance?
  • How are AWS credentials configured?
    Kindly note that if configured in default profile and application is deployed in IIS, then the user account under which application is being executed is not same as the logged in user for most cases.
  • Could you enable the verbose logging using the below code and share the detailed logs:
Amazon.AWSConfigs.LoggingConfig.LogResponses = Amazon.ResponseLoggingOption.Always;
Amazon.AWSConfigs.LoggingConfig.LogTo = Amazon.LoggingOptions.SystemDiagnostics;
Amazon.AWSConfigs.AddTraceListener("Amazon", new System.Diagnostics.ConsoleTraceListener());

Thanks,
Ashish

from aws-logging-dotnet.

github-actions avatar github-actions commented on August 24, 2024

This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

from aws-logging-dotnet.

GSFAtArrow avatar GSFAtArrow commented on August 24, 2024

Hi Ashish,

What is the type of application (or the Visual Studio template used)? Is it .NET Framework Web API project?

A .NET Framework 4 Web API application.

Is possible, please share the sample code solution (you may ZIP it and attach it to this issue) for faster troubleshotting.

Unfortunately not, the application is large and the code is under IP protection but I have added the CloudWatch logger code in the first message above.

Also share the deployment/execution steps. How are you executing the application?

The application is running in IIS on an EC2 instance.

How are AWS credentials configured?

The application runs under the context of an AWS Role which has an AWS Profile which has the required CloudWatch permissions. I see that the CloudWatch Log Streams get created so I know that some permissions are being applied. My first assumption was that the Log Streams are empty because the PutLogEvents permission was missing but on checking I see that it is present.

Could you enable the verbose logging using the below code and share the detailed logs:

I already did this and couldn't find anything useful from the logs. The log file is very large now but I will try to extract some of it and add it here.

Thanks.

from aws-logging-dotnet.

GSFAtArrow avatar GSFAtArrow commented on August 24, 2024

Hi Ashish,
log4netdiagnostics.txt

I have attached a small snippet from the log4netdiagnostics file. I couldn't find any error messages in here. This section appears to keep repeating.

from aws-logging-dotnet.

ashishdhingra avatar ashishdhingra commented on August 24, 2024

Hi Ashish,

What is the type of application (or the Visual Studio template used)? Is it .NET Framework Web API project?

A .NET Framework 4 Web API application.

Is possible, please share the sample code solution (you may ZIP it and attach it to this issue) for faster troubleshotting.

Unfortunately not, the application is large and the code is under IP protection but I have added the CloudWatch logger code in the first message above.

Also share the deployment/execution steps. How are you executing the application?

The application is running in IIS on an EC2 instance.

How are AWS credentials configured?

The application runs under the context of an AWS Role which has an AWS Profile which has the required CloudWatch permissions. I see that the CloudWatch Log Streams get created so I know that some permissions are being applied. My first assumption was that the Log Streams are empty because the PutLogEvents permission was missing but on checking I see that it is present.

Could you enable the verbose logging using the below code and share the detailed logs:

I already did this and couldn't find anything useful from the logs. The log file is very large now but I will try to extract some of it and add it here.

Thanks.

@GSFAtArrow The logs shared by you are not verbose logs emitted by AWS SDK for .NET. Since you are using .NET Framework 4 application, you may try following steps at Logging with the AWS SDK for .NET to enable verbose logging. Depending on the options you enable, it should either write to log file you specify and/or SystemDiagnostics.

Also, if it is your test EC2 instance, you may also try using network monitoring tools (e.g. Fiddler) to examine why requests to put log events to CloudWatch logs are failing. Kindly note that it might take a while for logs to appear in CloudWatch logs, so kindly recheck if logs are still missing.

Also, just curious, have you somehow configured credentials at other location(s) mentioned in Credential and profile resolution? Notice that Amazon EC2 instance metadata is resolved last. Also, an application in IIS runs under a different account by default, hence EC2 instance metadata credentials are the way to go (which you are already using).

Thanks,
Ashish

from aws-logging-dotnet.

GSFAtArrow avatar GSFAtArrow commented on August 24, 2024

Hi Ashish,

Thanks for the reply. You wrote:-

Since you are using .NET Framework 4 application, you may try following steps at Logging with the AWS SDK for .NET to enable verbose logging

Apologies, I read through the link and can't find any mention of how to enable verbose logging for System.Diagnostics. Here is what our web.config section is:-

image

What should I change here to enable verbose logging?

Thanks.

from aws-logging-dotnet.

ashishdhingra avatar ashishdhingra commented on August 24, 2024

Hi Ashish,

Thanks for the reply. You wrote:-

Since you are using .NET Framework 4 application, you may try following steps at Logging with the AWS SDK for .NET to enable verbose logging

Apologies, I read through the link and can't find any mention of how to enable verbose logging for System.Diagnostics. Here is what our web.config section is:-

image

What should I change here to enable verbose logging?

Thanks.

@GSFAtArrow My apologies if this was unclear. Also refer Allowed Elements in Configuration Files Reference for AWS SDK for .NET (only applies to .NET Framework). For logging section, you could select set logResponses="Always". This would enable verbose logging.

Thanks,
Ashish

from aws-logging-dotnet.

github-actions avatar github-actions commented on August 24, 2024

This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

from aws-logging-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.