Coder Social home page Coder Social logo

Comments (8)

saleem-mirza avatar saleem-mirza commented on August 11, 2024 1

@buzallen @nblumhardt

I have created a test dotnet core web application with Serilog.Sinks.AzureDocumentDB sink configured and deployed as Azure App Service. It's been running for few hours and I haven't noticed any issue with logging.

Please keep in mind that new sink requires dotnet core version 1.1.0+. I'm closing this issue. However, if you still have issue with sink, feel free to leave a message.

from serilog-sinks-azuredocumentdb.

nblumhardt avatar nblumhardt commented on August 11, 2024

Thanks for the report - sounds like some investigation is needed. Let us know if you need help making sense of what's going on in there πŸ‘

from serilog-sinks-azuredocumentdb.

saleem-mirza avatar saleem-mirza commented on August 11, 2024

@buzallen, Thanks for reporting issue. I'll investigate what's going on. However, this sink is using preview version of Microsoft Azure DocumentDB driver so bugs are expected and may not be used for production. Please see https://www.nuget.org/packages/Microsoft.Azure.DocumentDB.Core/

from serilog-sinks-azuredocumentdb.

buzallen avatar buzallen commented on August 11, 2024

Thanks @saleem-mirza , that's a good point. I'm testing sinks for now but I'll keep that in mind when it's time to move forward.

from serilog-sinks-azuredocumentdb.

nblumhardt avatar nblumhardt commented on August 11, 2024

Saleem, you're a powerhouse :-) kudos for all of your work on this sink!

from serilog-sinks-azuredocumentdb.

buzallen avatar buzallen commented on August 11, 2024

Thanks @saleem-mirza. Interesting I still have the issue on my end. I'll have to investigate if something is configured incorrectly on my end. I get about 5 minutes of logs to the document db and then it stops writing anything. I'll re-post here if I discover anything. Thanks again.

from serilog-sinks-azuredocumentdb.

saleem-mirza avatar saleem-mirza commented on August 11, 2024

@buzallen my project.json, Startup.cs and Controller looks like as

Note: I removed unrelated stuff for sake of brevity

project.json

    {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0",
          "type": "platform"
        },
        "Serilog": "2.3.0",
        "Serilog.Sinks.AzureDocumentDb": "3.5.17"
      },
      "frameworks": {
        "netcoreapp1.6": {
          "imports": [
            "dotnet5.6",
            "dnxcore50",
            "portable-net45+win8"
          ]
        }
      }
    }

Startup.cs (ConfigureServices)

        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddDbContext<ApplicationDbContext>(options =>
                options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));

            services.AddIdentity<ApplicationUser, IdentityRole>()
                .AddEntityFrameworkStores<ApplicationDbContext>()
                .AddDefaultTokenProviders();

            services.AddMvc();

            services.AddSingleton<Serilog.ILogger>(
                new Serilog.LoggerConfiguration()
                .WriteTo.AzureDocumentDB(
                    "https://xxxxx.documents.azure.com:443/",
                    "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                )
                .MinimumLevel.Verbose()
                .CreateLogger());
        }

HomeController.cs

    public class HomeController : Controller
    {
        Serilog.ILogger _logger;

        public HomeController(Serilog.ILogger logger)
        {
            _logger = logger;
            _logger.Information("HomeController constructor called.");
        }

    ...

Hopefully, it will shed some light.

from serilog-sinks-azuredocumentdb.

buzallen avatar buzallen commented on August 11, 2024

Thanks again @saleem-mirza . Switching to your implementation does work. For reasons I'm unsure of when I set it up like I do in my original post above is when it stops logging.

from serilog-sinks-azuredocumentdb.

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.