You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Controller where i am calling this logger:-
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using AspdotnetCore.cars;
using AspdotnetCore.YTBModels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Extensions.Logging;
namespace AspdotnetCore.controllers
{
public class HomeController
{
private static Logger logger = LogManager.GetLogger("file"); // For file
private static Logger log=LogManager.GetLogger("database"); // For Name
public HomeController()
{
}
public string Index()
{
logger.Warn("inside file logger from logger"); // It is writing file successfully
log.Warn("inside index from log"); // It is not inserted into database table.
return "In index method";
}
}
}
The text was updated successfully, but these errors were encountered:
My logs are not inserted into database.But logs are stored in file succesfully.
Here is my 'nlog.cofig"
My Controller where i am calling this logger:-
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using AspdotnetCore.cars;
using AspdotnetCore.YTBModels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Extensions.Logging;
namespace AspdotnetCore.controllers
{
public class HomeController
{
private static Logger logger = LogManager.GetLogger("file"); // For file
private static Logger log=LogManager.GetLogger("database"); // For Name
public HomeController()
{
}
public string Index()
{
logger.Warn("inside file logger from logger"); // It is writing file successfully
log.Warn("inside index from log"); // It is not inserted into database table.
return "In index method";
}
}
}
The text was updated successfully, but these errors were encountered: