본문으로 바로가기
반응형

IIS 에서 Event Log(이벤트)를 사용할때 System.Security.SecurityException

이 나타나는경우가 있다. 에러로그의 경우 log4net 이나 파일, 기타 처리로 사용을 하게 되는데, 이벤트 로그를 사용할 경우에 IIS 셋팅 부분 or 풀(pool) 의 권한으로 에러가 날 수 있다. 

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application’s trust level in the configuration file.

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security


에러는 이벤트 로그에 접근할 수 있는 권한이 없다인데, 구글링을 해 보면. 레지스트리에 2가지 항목의 권한을 추가해 주는 것으로 해결할 수 있다. 


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Security



위 그림과 같이 IIS를 사용하는 계정(NETWORK SERVICE)을 추가 모든 권한을 주면 됩니다. 

위와 같이 권한을 넣어주고 IIS를 리셋해 주면 이제 에러가 발생하지 않습니다. 







반응형