pryLogger 0.2.6
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package pryLogger --version 0.2.6
NuGet\Install-Package pryLogger -Version 0.2.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="pryLogger" Version="0.2.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add pryLogger --version 0.2.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: pryLogger, 0.2.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install pryLogger as a Cake Addin #addin nuget:?package=pryLogger&version=0.2.6 // Install pryLogger as a Cake Tool #tool nuget:?package=pryLogger&version=0.2.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
pryLogger
This sample project demonstrates the usage of the pryLogger
library for event logging and error handling in a C# application. The application makes REST API calls and configures email notifications in case of errors.
Requirements
- Connection Database: Ensure you have an database set up with a valid connection string, in this case is with Oracle
Usage Example
using Oracle.ManagedDataAccess.Client;
using pryLogger.src.Rest;
using pryLogger.src.Rest.Xml;
using pryLogger.src.Log.Attributes;
using pryLogger.src.Log.Strategies;
using pryLogger.src.ErrorNotifier.MailNotifier;
public class Program
{
public static void onException(Exception ex)
{
Console.WriteLine($"catchException : {ex.Message}");
}
[ConsoleLog]
static void level1([LogRename("customParam")] string test = "lala land")
{
level2();
//var dt = ConnectionManager.Instance.GetConnection<OracleConnection>().SelectQuery("select query. ...");
throw new Exception();
}
[ConsoleLog(nameof(onException))]
static void level2()
{
string url = "url";
var body = new { };
var res = RestClient.Fetch<object>(new RestRequest(url)
{
Method = "POST",
Content = Soap.CreateXmlRequest("urlRequest", null, body, Declarations.UTF8),
ContentType = "text/xml; charset=UTF-8",
}, rest =>
{
object result = Soap.FromXmlResponse("response", rest.Content);
return result;
});
}
static void Main(string[] args)
{
string connectionString = "database connection string";
string mailConnectionString = "host=mailhost; port=1234; from=cari@test.com; to=anothermail; repo=gitrepository.git";
ConsoleLog.MailErrorNotifier.SetConnectionString(mailConnectionString);
//ConnectionManager.Instance.SetConnectionString<OracleConnectionStringBuilder>(connectionString);
level1();
Console.ReadKey();
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.5
- LiteDB (>= 5.0.16)
- MrAdvice (>= 2.9.9)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Added logging functionality to files, lite.db file and the console.
- Implemented event management for REST APIs and databases.
- Introduced database connection management.
- Included extensions for XML handling within a REST API.