Introduction
The .log file in a LevelDB
database directory stores the recent updates, before they are written into
sorted table files. It is a binary file, not a text
log; many other programs use .log for unrelated text files.
Structure
The file is a series of 32 KB blocks; only the last may be partial. Each block holds records, and a long record is split into fragments of type FIRST, MIDDLE and LAST; one that fits is of type FULL.
0Checksum CRC-32C of the type and data, little-endian4 bytes4Length of the data, little-endian2 bytes6Type 1 FULL, 2 FIRST, 3 MIDDLE, 4 LAST1 byte7Datalength bytes
Not described
This page is a first outline. The details of the layout are not yet described here.
Known, not yet covered
- Reference: the checksum masking and what the record data holds, which LevelDB’s source defines.
- Viewer: the site has no viewer for this format.
Also used for
- Cabrillo Contest Log – Text log of amateur radio contest contacts sent to sponsors.
- Common Log Format – Apache and nginx access logs: one request per line, in fixed fields.
- Plain text log – One event per line of text, usually led by a time, as syslog writes it.
- W3C Extended Log File Format – IIS web logs: a #Fields directive names the fields on every line.
Links
Developers
- LevelDB – Google’s library (C++)
Reference
- Log format – LevelDB documentation