Open Closed

Create log file one per day #2208


User avatar
0
jjlbj created

How to configure ABP for create one log file per day.

ABP Framework version: v4.2.2 UI type: MVC **DB provider: **EF Core Tiered (MVC) or Identity Server Separated (Angular): no Exception message and stack trace: Steps to reproduce the issue:"

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    We're using Serilog.Sinks.Async in templates.

    Update:

    Log.Logger = new LoggerConfiguration()
                    .WriteTo.Async(c => c.File("Logs/logs.txt"))
    

    to

    Log.Logger = new LoggerConfiguration()
                    .WriteTo.Async(c => c.File("Logs/logs.txt", rollingInterval:RollingInterval.Day))
    

    Or you can directly use Serilog File Sink

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @jjlbj

    It's not related with ABP. You can do it configuring Serilog like below: https://stackoverflow.com/a/28334074/7200126

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    jjlbj created

    Great !!! Works fine. Thanks !!!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.