MTESSDev / SejilSQL

Capture, view and filter your ASP.net core log events right from your app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sejil

Sejil is a library that enables you to capture, view and filter your ASP.net core app's log events right from your app. It supports structured logging, querying as well as saving log event queries.

This version let you centralize all your applications logs in one place.

Quick Links

Getting started

  1. Installing Sejil package

  2. Adding code Add below code to Program.cs:

    public static IWebHost BuildWebHost(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .AddSejil(new SejilSettings("/sejil", LogEventLevel.Debug));
            // ...

    Add below code to Startup.cs

    using Sejil;
    
    public class Startup
    {    
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseSejil();
            // ...
        }
    }

    (Optional) To require authentication for viewing logs:

        public void ConfigureServices(IServiceCollection services)
        {
            services.ConfigureSejil(options =>
            {
                options.AuthenticationScheme = /* Your authentication scheme */
            });
        }

    (Optional) To change the logs page title (Defaults to Sejil if not set):

        public void ConfigureServices(IServiceCollection services)
        {
            services.ConfigureSejil(options =>
            {
                options.Title = "My title";
            });
        }

    (Optional) Hosted Service to cleanup logs DB:

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton<SejilService>();
            services.AddHostedService<SejilCleanupService>();
            services.ConfigureSejil(options =>
            {
                options.Title = "Logs";
                options.LogRetentionDays = 30;
            });
        }
  3. Navigate to http://your-app-url/sejil to view your app's logs.

Features and Screenshots

  • View your app's logs

  • View properties specific to a certain log entry

  • Query your logs

  • Mix multiple filters with your query to further limit the results

  • Save your queries for later use

  • Load your saved queries

Building

To build the project, you just need to clone the repo then run the build command:

git clone https://github.com/alaatm/Sejil.git
cd ./Sejil
./build.ps1  # If running Windows
./build.sh   # If running Linux/OSX

You can run one of the sample apps afterwards:

cd ./sample/SampleBasic
dotnet run

License

License

Copyright © Alaa Masoud.

This project is provided as-is under the Apache 2.0 license. For more information see the LICENSE file.

About

Capture, view and filter your ASP.net core log events right from your app

License:Apache License 2.0


Languages

Language:HTML 86.9%Language:C# 8.9%Language:TypeScript 2.9%Language:CSS 0.5%Language:PowerShell 0.4%Language:Shell 0.2%Language:JavaScript 0.1%