{this.formatDate(this.props.date)}
\r\n \r\n\r\n\r\n"Specified argument was out of the range of valid values. Parameter name: foo"
.\r\n throw new ArgumentException("foo")
), as this violates the signature (public ArgumentException(string message)
), by providing no message with details of the issue.\r\n\r\n\r\n <configuration>
element\r\n \r\n{`\r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n `}\r\n
\r\n
\r\n \r\n <configsection>
is at the top of the file, just under <configuration>
.\r\n C:/Temp/log.txt
, and append to it. As this just creates one ever expanding file, it's only really useful for debugging. See instructions below on configuring NLog to create a new timestamped log file on each application launch.\r\n \r\n{`Logger _logger = LogManager.GetLogger(\"log\");\r\n_logger.Error(\"Foo\");\r\n_logger.Info(\"Bar\");\r\n// etc...`}
\r\n
{``}
\r\n {\"${longdate}\"}
to get timestamped log lines){\"\"}\r\n
\r\n
\r\n \r\n{`Exception e = ...\r\n_logger.Error(\"Uh oh: \", e);`}
\r\n %AppData%/YourAppName
(no need to create this beforehand){\"\"}\r\n
\r\n
\r\n <logger name=\"log\" writeTo=\"log\" minlevel=\"Warning\"/>
\r\n \r\n{`\r\n \r\n\r\n `}\r\n
\r\n Logger _logger = LogManager.GetCurrentClassLogger();\r\n
\r\n\r\n http://www.nlog-project.org/schemas/NLog.xsd
somewhere (\r\n C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Xml\\Schemas
is a good place). \r\n Go to App.config properties -> Schemas -> Add NLog.xsd.\r\n \r\n{`\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `}
\r\n \r\n{`var config = new LoggingConfiguration();\r\n\r\nvar target = new FileTarget();\r\ntarget.Name = \"log\";\r\ntarget.FileName = @\"\\${specialfolder:folder=ApplicationData}/YourAppName/log_\\${cached:\\${longdate}:cached=true}.txt\";\r\ntarget.Layout = @\"\\${longdate} \\${message} \\${exception:format=tostring}\";\r\nconfig.AddTarget(\"log\", target);\r\n\r\nvar rule = new LoggingRule(\"*\", LogLevel.Trace, target);\r\nconfig.LoggingRules.Add(rule);\r\n\r\nLogManager.Configuration = config;`}\r\n
\r\n