User-1350042179 posted
Hi
I have the code:
public static void Initialize(string nombre, string ruta)
{
var config = new LoggingConfiguration();
var target = new FileTarget(nombre);
target.FileName = string.Concat(ruta, "/", nombre, "_${shortdate}.txt");
target.Layout = string.Concat("===================================================================================================================================================================================",
"${newline}Hora: ${longdate}.${newline}Nivel: ${level:upperCase=true}.${newline}Mensaje: ${message}.${newline}Source: ${callsite:includeSourcePath=true}.${newline}Linea: ${callsite-linenumber}.${newline}Stacktrace: ${stacktrace:topFrames=10}.${newline}Exception: ${exception:format=ToString}${newline}${newline}");
var rule = new LoggingRule("*", LogLevel.Debug, target);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
}
I don't know the meaning of:
${level:upperCase=true}
Besides, I am not sure about this line:
var rule = new LoggingRule("*", LogLevel.Debug, target);
I suppose that the meaning is: Nlog will register
Debug
Info
Warn
Error
Fatal
I have another question:
The aplication will register Debug information automatically or I have to create custom code.