Error Log — this archived support thread from the APG vNext community covers a reported issue and its resolution.
Troubleshooting This Issue
- Set
customErrors mode="Off"inweb.configto expose the full error and stack trace. - Check Windows Event Viewer → Application log for ASP.NET exceptions.
- Review Admin Panel → Logs → Error Log for timestamped application errors.
- Restart the IIS Application Pool to clear stale state.
- Verify the database connection string and run any pending upgrade SQL scripts.
Related Resources
Understanding and Managing the APG vNext Error Log
The APG vNext error log is the first place to look when diagnosing forum problems. It captures all unhandled exceptions with full stack traces and request context. This guide covers how to read, filter, and act on error log entries, and how to prevent log flooding from recurring errors.
Error Log Schema
SELECT TOP 1 * FROM apg_ErrorLog;
-- Key columns:
-- ErrorID INT IDENTITY PRIMARY KEY
-- ErrorType NVARCHAR(200) -- exception type name
-- ErrorMessage NVARCHAR(MAX) -- exception message
-- StackTrace NVARCHAR(MAX) -- full stack trace
-- RequestUrl NVARCHAR(500) -- URL that triggered the error
-- QueryString NVARCHAR(500) -- URL parameters
-- MemberID INT NULL -- logged-in user (NULL for guests)
-- ClientIP NVARCHAR(50) -- requester's IP
-- OccurredAt DATETIME -- UTC timestamp
Filtering by Error Type
-- Find only SQL-related errors in the last 7 days:
SELECT ErrorType, ErrorMessage, RequestUrl, OccurredAt
FROM apg_ErrorLog
WHERE ErrorType LIKE '%Sql%'
AND OccurredAt > DATEADD(DAY, -7, GETDATE())
ORDER BY OccurredAt DESC;
Suppressing Known Benign Errors
<!-- Stop logging 404 errors (high volume, low value) -->
<add key="APG.Error.Suppress404" value="true" />
<!-- Stop logging invalid request errors from bots -->
<add key="APG.Error.SuppressBadRequest" value="true" />
Auto-Purge Old Error Logs
<!-- Automatically delete errors older than N days -->
<add key="APG.Error.RetentionDays" value="30" />
Correlating Error Logs with IIS Logs
For complex issues where the APG vNext error log doesn't contain enough context, correlate it with IIS access logs and Windows Event Viewer entries using the timestamp and client IP. IIS logs (typically at C:\inetpub\logs\LogFiles\W3SVC1\) record every request with the HTTP status code, time taken, bytes sent, and the user agent — cross-referencing these with APG vNext error log entries for the same timestamp and IP address reveals the full request lifecycle and any upstream errors (e.g., 502 from a downstream service, 503 from IIS application pool recycling) that contributed to the application error.
Log Aggregation for Multi-Server Deployments
In multi-server APG vNext deployments, each web server writes errors to the same shared SQL Server database (since all servers share the same APG vNext database), so the error log in Admin Panel is already aggregated. However, the ClientIP and RequestUrl columns allow you to identify which type of request is causing errors. For IIS log correlation, configure a centralised logging service (ELK stack, Azure Log Analytics, or Seq) to collect IIS logs from all servers and allow cross-server correlation using timestamps and request IDs.
Exporting Error Log Data for Analysis
For larger APG vNext deployments where error patterns need systematic analysis, export the error log data to a CSV for offline analysis or import into a business intelligence tool:
-- Export last 30 days of errors with frequency grouping:
SELECT ErrorType,
LEFT(ErrorMessage, 100) AS MessageSummary,
COUNT(*) AS Occurrences,
MIN(OccurredAt) AS FirstSeen,
MAX(OccurredAt) AS LastSeen
FROM apg_ErrorLog
WHERE OccurredAt > DATEADD(DAY, -30, GETDATE())
GROUP BY ErrorType, LEFT(ErrorMessage, 100)
ORDER BY COUNT(*) DESC;
Error Log Data Retention and GDPR Compliance
The APG vNext error log stores the client IP address and member ID of the user whose request triggered each error. Under GDPR and similar privacy regulations, IP addresses are considered personal data. Configure an appropriate error log retention policy that balances debugging needs against privacy obligations. The default retention of 30 days is typically compliant for error log data (error diagnosis is a legitimate interest that justifies temporary retention of IP addresses). Longer retention periods require explicit justification. When processing data subject requests, note that error log entries containing a member's user ID should be included in data export responses and anonymised (IP address zeroed out and member ID set to NULL) in deletion/erasure requests:
-- Anonymise error log entries for a departing member:
UPDATE apg_ErrorLog
SET MemberID = NULL,
ClientIP = '0.0.0.0'
WHERE MemberID = @MemberIDToAnonymise;
-- Purge old errors beyond retention window:
DELETE FROM apg_ErrorLog
WHERE OccurredAt < DATEADD(DAY, -30, GETDATE());
Error Log Access Controls
Restrict access to the error log in Admin Panel to administrators who need it for debugging purposes. The error log may contain sensitive information including partial user inputs that triggered validation errors, URL parameters with user data, and IP addresses. In APG vNext, error log access is controlled by the Admin Panel role permission system — assign the Error Log View permission only to technical administrators, not to moderators or content administrators who do not need database-level debugging information.
Related Resources
Looking for more help? Browse the support forum or check the Knowledge Base.