cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LLS Failed to log event in Windows Event Log in some flavors of Windows

LLS Failed to log event in Windows Event Log in some flavors of Windows

Symptoms:

When installing the LLS as a service using the 'Network Service' account. It's  been observed that some flavors of Windows do not have the privilege to write into  windows event log and produces errors.

Diagnosis:

Its necessary to run LLS with elevated permissions so that it has the access to windows registry and events, but some organization doesn't have this policy which makes LLS to run into these errors and eventually stop running.

2018-10-22 10:20:09,670 INFO - Starting C:\Program Files\Java\jdk1.8.0_281\jre\bin\java.exe -Xms1g -Xmx1g -XX:MetaspaceSize=256m -XX:+UseG1GC -XX:NewRatio=3 -XX:MaxGCPauseMillis=75 -XX:G1HeapWastePercent=10 -XX:InitiatingHeapOccupancyPercent=75 -XX:+CMSScavengeBeforeRemark -XX:+ScavengeBeforeFullGC -jar flexnetls.jar -service -producer-settings producer-settings.xml -port 7070
2018-10-22 10:20:10,655 INFO - Started 2978
2018-10-22 10:21:13,930 ERROR - Failed to log event in Windows Event Log. Reason:
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
at System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate)
at System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type)
at winsw.WrapperService.LogEvent(String message, EventLogEntryType type

 

Solution:

 You can try to follow below work-around:

  1. Open the Windows Registry Editor

  2. Navigate/expand to the following key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security

  3. Right click on this entry and select Permissions

  4. Add the Network Service user

  5. Give it Read permission

    If above doesn't help, run the LLS with elevated permissions and adjust the group policies in place for the Network User.

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jun 30, 2022 04:17 AM
Updated by:
Contributors