Skip to content

Program hangs forever when using MongoDB sink with Serilog.Extensions.Hosting #92

Open
@teneko

Description

@teneko

Using Serilog.Sinks.MongoDB 7.0.0, the program immediatelly hangs forever when using:

services.AddSerilog((sp, cfg) => {
    var mongoDatabase = sp.GetRequiredService<IMongoDatabase>();
    const string loggingCollectionName = "Logs";
    cfg.WriteTo.MongoDBCapped(mongoDatabase, collectionName: loggingCollectionName);
}, writeToProviders: true);

Not good. Commenting out cfg.WriteTo.MongoDBCapped leads the program to work as expected. Any ideas?

Serilog.Sinks.Async does not fix it. It must be a MongoDB sink specific problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions