DoLog 1.2.0
dotnet add package DoLog --version 1.2.0
NuGet\Install-Package DoLog -Version 1.2.0
<PackageReference Include="DoLog" Version="1.2.0" />
paket add DoLog --version 1.2.0
#r "nuget: DoLog, 1.2.0"
// Install DoLog as a Cake Addin
#addin nuget:?package=DoLog&version=1.2.0
// Install DoLog as a Cake Tool
#tool nuget:?package=DoLog&version=1.2.0
DoLog is a logging application which helps you to log in a CSV file by just plugged in. Install it through Nuget package and your logging functionality is ready.
Steps to Add DoLog:
1. Run the command from Nuget package manager console.
2. Add the namespace
using DoLogLibrary; // put it in namespace section
3. For windows applications, you don't need to set the log file location path. For web application write the below code in App_Start method in Global.ascx.
DoLog.SetLogLocation(Server.MapPath("~")); // Set the location of log file for web application
4. For Logging use method Log under DoLog class. This is a static method, so you don't need to create any kind of object.
Examples:
DoLog.Log("Application Starts");
DoLog.Log(ex.Message,"Error");
DoLog.Log("Application Ends", "Info");
"Log" takes two parameters. first one is the message and second one is the level of message(like info, warning, error or anything user puts).
Method returns a tuple<bool, string>
first items state whether logging operation is successful or not, and second item states the location of log file.
In our new version you can also log data in Database. A database table named TBL_DOLOG will be created and all the log data will be stored over there.
To access this feature use method LogDB() and SetConnectionString().
Example:
// Set the connection string first
DoLog.SetConnectionString(@"Data Source=localhost;Integrated Security=True;Initial Catalog=TestDB;");
// Do the logging operation (return true or false)
DoLog.LogDB("This is a test data.");
DoLog.LogDB(ex.Message,"Error");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- SampleDependency (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Released version 1.2.0 where use can log in both file system and database table.