-
Notifications
You must be signed in to change notification settings - Fork 1
Log context infos
DUONG Phu-Hiep edited this page Oct 12, 2016
·
5 revisions
using log4net;
using ToolsPack.Log4net;
using System.IO;
using System.Diagnostics;
using System.Reflection;
private static readonly ILog Log = LogManager.GetLogger(typeof(Global));
Log4NetQuickSetup.SetUpFile(@"D:\dev\ws_dev03\lemonway_webservice_mb_xml\bin\Logs");
Log.InfoFormat(".NET Framework CLR version = {0} (4.0.30319.42000 = .NET 4.6 and 4.0.30319.x = .NET 4.0-4.5)", Environment.Version);
Log.InfoFormat("Environment.CurrentDirectory = {0}", Environment.CurrentDirectory);
Log.InfoFormat("Directory.CurrentDirectory = {0}", Directory.GetCurrentDirectory());
var assemblyLocation = Assembly.GetExecutingAssembly().Location;
Log.InfoFormat("ExecutingAssembly.Location = {0}", assemblyLocation);
Log.InfoFormat("ExecutingAssembly.Version = {0}", FileVersionInfo.GetVersionInfo(assemblyLocation).FileVersion);
Log.InfoFormat("Environment.UserDomainName = {0}", Environment.UserDomainName);
Log.InfoFormat("Environment.User = {0}", Environment.UserName);
Log.InfoFormat("RunAs User = {0}", System.Security.Principal.WindowsIdentity.GetCurrent().Name);