에서는 C#으로 Windows 이벤트 로그에 문제가 발생합니다.C# 일부 문자열에서는 EventLog.WriteEntry가 실패하지만
string msgGrid = "pdtidtijejrnexhr";
string msgIntern = "*-* [Dt:2013-10-31 11:41:10.00][digkufdufe:{[<2013-10-31 11:41:09> {jpdriskrt01} jpdriskrt01[172.22.3.70:57010]> [pdtidhry jrnecidr]]} : {}] >>#[eydshr:(rhrdhruiweirts.hrt.krt.krtjelr.jt.jpdrtjelkrhtw.<dnjr>b__1)]>>#[jpdrtjelkrhtw]\\[pdtidtijejrnexhr]\r\n";
writeToEventLog(msgGrid, msgIntern, EventLogEntryType.FailureAudit);
가 // folowing 코드 확인을 작동 : :이 folowing 코드는 이벤트 로그에 항목을 넣어 해달라고 //
public static void writeToEventLog(string msgGrid, string msgIntern, EventLogEntryType entryType)
{
string grp = "Application"; // Fixed because cant create new but happy if bellow works.
if (!EventLog.SourceExists(msgGrid)) { EventLog.CreateEventSource(msgGrid, grp); }
EventLog.WriteEntry(msgGrid, msgIntern, entryType);
}
writeToEventLog("t1", "t2", EventLogEntryType.FailureAudit);
이 일부 로그 내용이나 크기에 대한 제약?
예외입니까? 동일한 코드 조각을 동일한 사용자로 실행하고 있습니까? ('CreateEventSource()'는 req'd privs에서만 작동합니다.) –
"fail"이라고하면 무엇을 의미합니까? –
@Lynn Crumbling 아니요, 예외는 아니지만 Visual Studio 2010 C# 4.0 디버그에서 동일한 사용자로 실행됩니다. 관리자 권한으로 Visual Studio를 실행합니다. – newway