Abstract
Software logs record system activities, aiding maintainers in identifying the underlying causes for failures and enabling prompt mitigation actions. However, maintainers need to inspect a large volume of daily logs to identify the anomalous logs that reveal failure details for further diagnosis. Thus, how to automatically distinguish these anomalous logs from normal logs becomes a critical problem. Existing approaches alleviate the burden on software maintainers, but they are built upon an improper yet critical assumption: logging statements in the software remain unchanged. While software keeps evolving, our empirical study finds that evolving software brings three challenges: log parsing errors, evolving log events, and unstable log sequences. In this paper, we propose a novel unsupervised approach named Evolving Log analyzer (EvLog) to mitigate these challenges. We first build a multi-level representation extractor to process logs without parsing to prevent errors from the parser. The multi-level representations preserve the essential semantics of logs while leaving out insignificant changes in evolving events. EvLog then implements an anomaly discriminator with an attention mechanism to identify the anomalous logs and avoid the issue brought by the unstable sequence. EvLog has shown effectiveness in two real-world system evolution log datasets with an average F1 score of 0.955 and 0.847 in the intra-version setting and inter-version setting, respectively, which outperforms other state-of-the-art approaches by a wide margin.
The Challenge of Software Evolution
In large-scale systems, logs are the primary breadcrumbs for troubleshooting. However, traditional anomaly detection tools rely on a "closed-world" assumption: they assume that the format and sequence of logs remain static. In reality, software is constantly evolving. Developers frequently update, paraphrase, or delete logging statements—studies show nearly 33% of logging statements change over a software's lifecycle.
This evolution creates three major headaches for automated tools:
- Parsing Errors: Traditional parsers (like Drain) fail when a log template changes slightly, leading to downstream data corruption.
- Evolving Events: New or paraphrased logs are often flagged as "unseen" and therefore "anomalous," leading to a flood of false positives.
- Unstable Sequences: Multi-threading and architectural changes make the order of logs unpredictable, breaking models that rely on strict sequence prediction.
The EvLog Methodology
EvLog tackles these issues through a two-stage, unsupervised pipeline designed to be robust against "log drift."
1. Multi-level Representation Extractor
Instead of using a parser to turn logs into rigid templates, EvLog uses deep learning to understand them semantically. It fine-tunes a Pre-trained Language Model (specifically BERT) on system logs, allowing it to recognize that "Task failed" and "Process terminated with error" are semantically similar. It then employs HDBSCAN, a density-based clustering algorithm, to group similar logs. This helps the system treat paraphrased logs across different software versions as the same "event," even if the wording has changed.
2. Anomaly Discriminator
EvLog shifts the paradigm from sequence prediction to "One-Class Classification." It learns the boundary of "normality" using a unitary discriminator for individual logs and a local discriminator that uses an attention mechanism to look at surrounding context. This allows the model to focus on important events while ignoring the noise of unstable sequences caused by interleaving threads. The model maps normal log features into a high-dimensional "hyper-sphere"; during testing, any log falling outside this sphere is flagged as an anomaly.
Key Results and Insights
EvLog was evaluated on LOGEVOL (a new dataset from Apache Spark and Hadoop) and SYNEVOL (a synthetic dataset with injected noise). The results demonstrate that while the syntax of logs changes during evolution, the semantics usually stay the same.
- Intra-version Performance: EvLog achieved an average F1 score of 0.955, comparable to state-of-the-art models.
- Inter-version (Cross-version) Robustness: This is where EvLog excels. When trained on Spark 2 and tested on Spark 3, baseline models saw their F1 scores plummet (some as low as 0.03) because they couldn't handle new log templates. EvLog maintained a robust average F1 score of 0.847.
By moving to a parser-free semantic approach, EvLog becomes immune to the minor formatting changes that break traditional tools, providing a more reliable solution for modern, evolving software systems.
Summary updated