What We've Learned About UniFi's Internal Logging Mechanism
Published onby Dries
At UniHosted, we’re committed to providing Managed Service Providers (MSPs) the most transparent, efficient, and powerful UniFi hosting available. Recently, our engineering team took a deep dive into the inner workings of Ubiquiti's UniFi Controller binary. Our aim: fully understand its internal logging mechanism to better serve our customers.
Today, we're sharing the results of our detailed investigation, offering unique insights into how UniFi handles logs internally—and how UniHosted leverages this knowledge to enhance your hosting experience.
Table of Contents
- Unpacking the UniFi Binary's Logging Configuration
- A Detailed Look at UniFi’s Logging Strategy
- Advanced Insights: Analytics & In-Memory Logging
- Log Levels: Filtering Signal from Noise
- Centralized Logging: How UniHosted Does It Better
- Final Thoughts
Unpacking the UniFi Binary's Logging Configuration
The UniFi Controller relies on Logback, a robust Java-based logging framework. The configuration we extracted from the binary clearly reveals how logs are managed behind the scenes.
Here's a snapshot of the core configuration we discovered:
<configuration>
<variable name="logDir" value="${logDir:-logs}"/>
<variable name="logPattern" value="[%date{\"yyyy-MM-dd'T'HH:mm:ss,SSSXXX\"}] <%thread> %-5level %-6logger{0} - %message%n"/>
...
</configuration>
The configuration centers around two key variables:
- Log Directory (
logDir
): Specifies the storage location (logs
by default). - Log Pattern (
logPattern
): Formats each log entry consistently for readability and quick parsing.
An example log line based on this pattern:
[2025-05-13T11:15:23,754+02:00] <http-nio-8080-exec-3> INFO inform_request - Device [MAC: AA:BB:CC:DD:EE:FF] checked in.
A Detailed Look at UniFi’s Logging Strategy
Through our internal investigation, we observed that UniFi strategically separates logs into several dedicated appenders. Each handles a specific functional domain, enabling easier troubleshooting and clearer diagnostics.
Here is our extracted breakdown of appenders and their intended uses:
Log File | Purpose | Max Size | Archived Copies |
---|---|---|---|
server.log |
General application logs | 10 MB | 3 |
state.log |
Controller state changes | 5 MB | 1 |
migration.log |
Database migrations | 10 MB | 1 |
tasks.log |
Scheduled tasks and background jobs | 1 MB | 1 |
hotspot.log |
Guest portal events | 500 KB | 1 |
inform_request.log |
Device connectivity and status updates | 10 MB | 3 |
startup.log |
Application startup events | N/A | 0 (overwritten on each start) |
UniFi employs rolling file strategies to prevent excessive log file growth, automatically archiving older logs upon reaching defined size limits.
Advanced Insights: Analytics & In-Memory Logging
We also uncovered specialized appenders in the binary, serving unique roles:
- InMemoryAppender (
com.ubnt.ace.logs.InMemoryAppender
): Keeps logs available in-memory, speeding up diagnostics accessible directly through the UniFi UI. - AnalyticsAppender (
com.ubnt.service.trace.logerror.AnalyticsAppender
): Captures and transmits critical errors to UniFi’s cloud-based error-tracking service, assisting Ubiquiti in proactively resolving significant issues.
Log Levels: Filtering Signal from Noise
UniFi uses standard logging levels internally, which we found clearly defined and structured in their configuration:
Level | Description | Example Use Case |
---|---|---|
ERROR | Critical errors, impacting system stability | Failed database migrations |
WARN | Potential issues, not immediately critical | Delayed device responses |
INFO | Standard operational information | Device check-ins |
DEBUG | Detailed diagnostic logs | Troubleshooting internal controller tasks |
Adjusting these levels can streamline logging verbosity, focusing only on what matters most to your MSP operations.
Centralized Logging: How UniHosted Does It Better
Understanding how the UniFi binary manages logs is not just an academic exercise—it directly informs our unique value proposition at UniHosted.
Unlike standard UniFi installations, UniHosted captures all logs centrally. Every log line generated by your UniFi Controller is securely forwarded to our robust central logging infrastructure. This enables:
- Instant Log Access: View logs directly from your UniHosted dashboard, eliminating tedious file digging.
- Advanced Analytics & Metrics: Automatically extract critical metrics from your log data to monitor and optimize system performance.
- Enhanced Troubleshooting: Quickly pinpoint issues across multiple deployments from one centralized location.
With UniHosted, log management becomes effortless and insightful, empowering you to proactively manage your networks.
Final Thoughts
Our detailed study into UniFi's internal logging mechanisms highlights our commitment to transparency, depth of knowledge, and continuous improvement at UniHosted. By understanding every aspect of the UniFi platform, we strive to deliver superior hosting experiences for MSPs worldwide.
For centralized logging, streamlined operations, and advanced insights into your UniFi deployments, trust UniHosted. If you would like me to personally walk you through UniHosted, you can schedule a call with me here.
We host UniFi Controllers in the Cloud
Are you ready to take your UniFi Network to the next level? Deploy a UniFi Cloud Controller in minutes and manage your network from anywhere.
Free tier available
Get the best support
Join 1660+ customers
No credit card required