The VersaTul Logger File project provides the functionality needed to performing logging in a flat file. This project implements the ILogger interface from the VersaTul Logger project.
$ dotnet add package VersaTul.Logger.FileThis project provides the functionality needed to perform logging in a flat file. This project implements the ILogger interface from the VersaTul Logger project.
To use this project, you need to have the VersaTul Logger project installed.
Then, you can install the VersaTul Logger File project by following these steps:
To use this project, you need to create an instance of the FileLogger class and pass it an instance of the LogFileConfiguration class. For example:
using VersaTul.Logger;
using VersaTul.Logger.File;
// Create a log file configuration with the file name, file path, and max file size
LogFileConfiguration config = new LogFileConfiguration("log.txt", @"C:\Logs", 1024 * 1024);
// Create a file logger with the configuration
FileLogger logger = new FileLogger(config);
// Use the file logger as you would use any ILogger
logger.Log(LogLevel.Info, "This is a test message");
The FileLogger class implements the ILogger interface, so you can use any of the methods defined in the VersaTul Logger project. For more information, see the VersaTul Logger documentation.
This project is licensed under the MIT License. See the LICENSE file for details.