"Caught Exception While Emitting to Sink" Error
Problem
When you try to view the HotDocs Advance log files, there is no logs folder in the standard location. When you check the Windows Event Viewer, you see the following message:
"Caught exception while emitting to sink Serilog.Sinks.RollingFile.RollingFileSink: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\Logs' is denied."
Cause
This error is typically caused when the IIS user under which Advance runs does not have permission to create and write to the log folder.
Solution
Create the Logs folder manually. Give the user account under which the Advance application pool runs the appropriate permissions to write to the log folder.
1. Check which user is used by the Advance application pool
- Open Internet Information Services (IIS) Manager.
- Expand the top-level Server node.
- Select the Application Pools node.
- Right-click the HdaAppPool application pool.
- Select the Advanced Settings option.
- Make a note of the user account that appears in the Identity field.
2. Give the user appropriate permissions to the Advance deployment folder
- Open Windows Explorer.
- Navigate to the HotDocs Advance deployment folder; by default, this is C:\inetpub\wwwroot\.
- In the folder, right-click and select New > Folder.
- Type Logs as the new name of the folder.
- Right-click the new Logs folder.
- Select the Properties option.
- Navigate to the Security tab.
- Click the Edit button.
- If the user account under which HdaAppPool runs does not appear in the Group or user names list:
- Click Add.
- Type the name of the user into the Enter the object names to select text field
- Click OK.
- Select the relevant user account in the Group or user names list.
- In the Permissions list, select Allow for the following options:
- Write
- Click OK.