Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injection doesn't work for AutofacChildLifetimeScopeConfigurationAdapter #46

Open
sguryev opened this issue Feb 3, 2021 · 0 comments
Open

Comments

@sguryev
Copy link

sguryev commented Feb 3, 2021

I have an application with the child scope built using this manual: https://github.com/autofac/Documentation/blob/master/docs/integration/aspnetcore.rst#using-a-child-scope-as-a-root

I have this code for registering Serilog in the child container

public void ConfigureContainer(AutofacChildLifetimeScopeConfigurationAdapter adapter)
{
    adapter.Add(builder =>
    {
        builder.RegisterLogger();
    });
}

Parent container has builder.RegisterLogger(); as well.
Context is missing in all cases:

  1. Do not configure child container at all and missing UseSerilog
  2. Add UseSerilog only
  3. Add ConfigureContainer call from the sample above
  4. 2nd + 3rd options together.

Sample log entry with the missing context between <>:
2021-02-03 16:53:37Z [4] DBG <> User login was denied. Reason = InvalidUsernameOrPassword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant