![]() |
VOOZH | about |
dotnet add package FlashLog --version 1.0.5
NuGet\Install-Package FlashLog -Version 1.0.5
<PackageReference Include="FlashLog" Version="1.0.5" />
<PackageVersion Include="FlashLog" Version="1.0.5" />Directory.Packages.props
<PackageReference Include="FlashLog" />Project file
paket add FlashLog --version 1.0.5
#r "nuget: FlashLog, 1.0.5"
#:package FlashLog@1.0.5
#addin nuget:?package=FlashLog&version=1.0.5Install as a Cake Addin
#tool nuget:?package=FlashLog&version=1.0.5Install as a Cake Tool
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extensions>
<add assembly="Microsoft.ApplicationInsights.NLogTarget" />
</extensions>
<targets>
<target
xsi:type="Console"
name="consoleTarget"
layout="${longdate} | ${level:uppercase=false} | ${logger} | ${message}">
</target>
<target
xsi:type="ApplicationInsightsTarget"
name="aiTarget"
instrumentationKey="[instrumentationKey]">
<contextproperty name="threadid" layout="${threadid}" />
</target>
<target
xsi:type="File"
name="fileTarget"
fileName="c:\logs\log.log"
layout="${longdate} | ${level:uppercase=false} | ${logger} | ${message}" />
<target
name="Mail"
xsi:type="Mail"
html="true"
subject="AspectLogger Trace"
body="${longdate} | ${level:uppercase=false} | ${logger} | ${message}"
to="[To_mail]"
from="[From_mail]"
Encoding="UTF-8"
smtpUsername="[From_mail]"
enableSsl="True"
smtpPassword="[Password]"
smtpAuthentication="Basic"
smtpServer="[smtp_server]"
smtpPort="[smtp_port]" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="consoleTarget,aiTarget,fileTarget" />
<logger name="*" minlevel="Error" writeTo="consoleTarget,aiTarget,fileTarget,Mail" />
</rules>
</nlog>
remember! this is your output settings: writeTo="consoleTarget,aiTarget,fileTarget"
consoleTarget = console window output aiTarget = application insights fileTarget = file in c:\logs\log.log
in case of exception a mail log too
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="logExceptionsOnly" value="false"/>
</appSettings>
</configuration>
keep in mind that:
<add key="logExceptionsOnly" value="true"/> //will print exceptions only
<add key="logExceptionsOnly" value="false"/> //will print EVERY function entry + exceptions
class Program
{
static void Main(string[] args)
{
MyClass testClass = new ();
testClass.Func1();
testClass.Func2();
}
}
// this is the logger attribute that will log every step and exception of your class
[AspectLogger]
public class MyClass
{
public void Func1()
{}
public void Func2()
{}
}
the output will be:
2022-01-02 09:02:49.4440 | Info | FlashLog.Logging.NLogLogger | Entering Method:".ctor"
2022-01-03 09:02:49.4441 | Info | FlashLog.Logging.NLogLogger | Entering Method:"Func1"
2022-01-03 09:02:49.4442 | Info | FlashLog.Logging.NLogLogger | Entering Method:"Func2"
Logger.GetLogger().Log("Print1");
the output will be:
2022-01-03 09:02:49.4580 | Info | FlashLog.Logging.NLogLogger | Print1
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.