1

I'm using .net core 3.1 with AWS lambda ( not serverless lambda, but a pure regular lambda).

I want to use Nlog as the logger library.

In a serverless lambda ( or a regular .net core project) , I could do this via :

 public static IWebHost BuildWebHost(string[] args) =>
            WebHost.CreateDefaultBuilder(args) 
                .UseStartup<Startup>() 
                .UseNLog()   //< -------here
                .Build();

But in simple aws lambda , I don't have IWebHost . All I have is:

FunctionHandler(object input, ILambdaContext context)  
{
 ...
}

Question:

How can I access IWebHost inside a regular aws lambda?

3

1 Answer 1

1

You can only access the IWebHost if you're using the lambda aspnet library.

https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.AspNetCoreServer/README.md

Av

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.