# SeasLog: a native PHP logger with buffers, templates and RFC5424 output

> SeasLog is a C extension for PHP that writes application logs with configurable templates, an in-memory buffer, directory and type separation, PSR-3 style interfaces and a separate analyser for counting and listing log records. It is published on PECL and documented on php.net, and its last tagged release is from January 2021.

**SeasX/SeasLog** — An effective,fast,stable log extension for PHP.http://pecl.php.net/package/SeasLog http://php.net/SeasLog

- Repository: https://github.com/SeasX/SeasLog
- Website: http://seasx.github.io/SeasLog/
- Stars: 1,195 · Forks: 274
- Language: C
- License: NOASSERTION
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/seasx-seaslog

## Why an extension rather than another log class

The README argues the case in its own terms, and the argument is worth repeating because it defines the target. The error_log and syslog functions built into PHP are powerful and perform well, but they have defects that reduce flexibility and do not meet application requirements, namely that error_log has no error level and no fixed format, and that syslog depends on the module being available and mixes with the system log. The gap is usually filled by a third party log class library such as log4php, plog or Analog, and of those log4php is the most famous, with the best designed document format and powerful features, and it is recommended. The counterargument the project makes is performance, with a chart comparing SeasLog and log4php in a concurrent test on Ubuntu 12.04 with an i3 CPU, 16 GB of memory and a SATA 7200 disk, and the stated conclusion is that log4php did badly on performance. That chart is the project's own measurement, so treat it as a claim rather than a benchmark, but the underlying point holds. If a logger runs in the same process as your request handler, its cost is your cost, and a C extension that buffers and writes outside the request path is a different proposition from a userland class.

## Two install routes, one of them a single command

SeasLog is a PHP extension, so it installs the way extensions do. The first route builds from source with the standard phpize sequence:

```sh
$ /path/to/phpize
$ ./configure --with-php-config=/path/to/php-config
$ make && make install
```

The second is the packaged route through PECL, and it is a single command:

```sh
$ pecl install seaslog
```

For Windows there is a third option, a prebuilt DLL from the PECL page for SeasLog. The extension is also documented on php.net, and the project keeps a Chinese version of the README alongside the English one, which tells you something about where its user base is. The repository is laid out like a standard PECL extension rather than a Composer library, with config.m4 and config.w32 for the Unix and Windows build systems, php_seaslog.h and seaslog.c at the top level, include/ and src/ for the sources, tests/ for the test suite, travis/ and .travis.yml plus .appveyor.yml for continuous integration, package.xml for the PECL package definition, and directories named Analyzer/, CodeTips/, EXPERIMENTAL/ and Specification/.

## The ini file, and a level setting that inverted in 1.7.0

Configuration lives in seaslog.ini under a [SeasLog] section, and the shipped defaults are worth reading closely because several of them are not what you would guess. The extension is loaded with extension = seaslog.so, the default log base path is /var/log/www, the default logger is named default, and the default date and time format is Y-m-d H:i:s. The default template is %T | %L | %P | %Q | %t | %M, which is a fixed pipe-separated layout of the variables the library exposes. Three switches decide how files are separated on disk: disting_folder is 1 by default so each logger gets its own directory, disting_type is 0 by default so the module is not part of the filename, and disting_by_hour is 0 by default so the folder is not split by hour. The memory buffer is off by default with seaslog.use_buffer = 0 and a buffer size of 100, and there is a separate switch to disable buffering in CLI, which defaults to off as well. The one setting with a trap is seaslog.level. The current default is 8, and the comment lists the scale from 0 for EMERGENCY to 8 for ALL. The note explains that the configuration item changed in 1.7.0: before that version a smaller value meant more logs were taken, with 0 for all and 8 for emergency, and the default was 0. An ini file carried over from 1.6 will therefore filter the opposite way, silently.

## Buffers, per-request identifiers and the file layout

The feature list is where the extension's real design shows. It records the log specification quickly inside the PHP project, it configures the default log directory and module, it can specify a log directory and capture the current configuration, it has a preliminary analysis of the early warning framework, and it provides an efficient log buffer with convenient buffer debugging. Two entries matter for anyone running this in production. The first is that it follows the PSR-3 logger interface specification, so the call sites look familiar even though the implementation is native. The second is support for a RequestId that differentiates requests, which is the standard way to make a log line attributable to one request when several are in flight. The buffering model is the piece that changes the performance profile, because with seaslog.use_buffer enabled the records accumulate in memory and are flushed rather than written on every call, and the extension documents buffer_size and a switch to disable buffering in CLI, where buffering buys nothing since the process exits. The template is customisable, and the README ships a default variable table, so a deployment can move from the default pipe-separated layout to whatever its log parser expects without changing application code.

## Shipping logs off the box with RFC5424

The extension can push records to a remote collector rather than only to disk, and it does so with a standard format. It supports connecting to a TCP port and sending with RFC5424, and it supports connecting to a UDP port and sending with RFC5424, and the documentation has a section on the data format when it is sent by TCP or UDP, which is the detail you need when pointing it at a syslog receiver. The documented way to release the stream flow from the logger manually is a separate section, and that matters for a long-running worker: a buffered logger that never flushes is a logger that loses the last records before a crash. The target the project states is convenient, standardised log records, efficient mass log analysis, and configurable multi-channel log warning, and the TCP and UDP support is the third of those. It is also the feature that turns a local file logger into something that can feed a central collector, at the cost of a network dependency in the logging path, which is a trade you should make deliberately rather than by default.

## The Analyzer and the early warning framework

The repository has a separate Analyzer/ directory, and the README documents the use of SeasLog Analyzer with a fast count of some type of log count value and the acquisition of some type of log list. In other words, the project ships a reader as well as a writer, and the reader's job is to answer questions about the log files after the fact, such as how many errors of a given kind occurred or which records of a kind exist. That is what makes the multi-channel warning in the target list workable, because an analyser that can count records by type is what turns a log directory into a signal. The specification of the log format also lives in the project, in Specification/, which is the file to read if you are writing the collector on the other end. The remaining directories, CodeTips/ and EXPERIMENTAL/, are where usage examples and work in progress live, and the presence of an EXPERIMENTAL directory in a project of this age is a reasonable signal of how the maintainers handle new ideas.

## Where SeasLog is the wrong tool, and the release gap

Four limits are clear. The first is that it needs a compiler on the machine, which rules out most managed PHP hosting, and PECL is not available everywhere either, so a team that has standardised on Composer-only dependencies cannot use it at all. The second is the release history. The tagged releases are SeasLog-2.2.0 with support for PHP 8 from 2021-01-19, 2.1.0 with PHP 7.4 support from 2020-01-01, and 2.0.2 with trace_performance support from 2019-02-12, and the last push to the repository was on 2026-05-24, so the source is being touched while the last published build predates most of the PHP 8 series. The third is scope. SeasLog writes logs, and it ships an analyser for counting them, but it is not an APM, it has no tracing, no metrics and no dashboards, so a team that wants to see what an application is doing over time is looking at the wrong tool. The fourth is the format commitment. The default template and the RFC5424 output are good choices, but they are choices, and once your collectors are parsing a specific layout, changing it is a migration rather than a configuration.

## Conclusion

Adopt SeasLog if you run PHP on a platform where you can install a PECL extension, you want a logger that does not sit in the request path, and you need a format your log tooling can parse. Do not adopt it if you cannot compile extensions, if you need a maintained release train, or if PSR-3 through a well-known userland logger already meets your needs. Before you pin a version, check whether the 2.2.0 build from 2021 is the one you would install, and read the level configuration carefully, because the meaning of seaslog.level inverted in 1.7.0 and an old ini file will silently filter the wrong records.

## FAQ

### What is SeasLog and what does it do?

SeasLog is a C extension for PHP that records application logs quickly, with configurable templates, an efficient memory buffer, per-request identifiers, and support for sending records over TCP or UDP using RFC5424. It follows the PSR-3 logger interface specification and is published on PECL.

### How do I install SeasLog?

You can build it from source with phpize, then `./configure --with-php-config=/path/to/php-config` and `make && make install`, or install the packaged build with `pecl install seaslog`. On Windows there is a prebuilt DLL available from the PECL page for SeasLog.

### How is SeasLog configured?

Through a seaslog.ini file with a [SeasLog] section, where you set the extension, the default base path, the default logger, the date and time format, the default template, the folder, type and hour separation switches, the memory buffer and its size, and the level filter.

### What changed about the level setting in version 1.7.0?

The configuration item changed meaning. Before 1.7.0 a smaller value meant more logs were taken, with 0 for all and 8 for emergency, and the default was 0. From 1.7.0 the scale runs from 0 for EMERGENCY to 8 for ALL, with a default of 8, so an older ini file filters the opposite way.

### Is SeasLog still maintained?

The last push to the repository was on 2026-05-24, but the most recent tagged release is SeasLog-2.2.0 with PHP 8 support from 2021-01-19, followed by 2.1.0 from 2020-01-01 and 2.0.2 from 2019-02-12. The licence is classified by GitHub as a custom one, with the text in the LICENSE file.

## Sources

- [Issues](https://github.com/SeasX/SeasLog/issues)
- [Project website](http://seasx.github.io/SeasLog/)
- [README](https://github.com/SeasX/SeasLog/blob/master/README.md)
- [Releases](https://github.com/SeasX/SeasLog/releases)
- [SeasX/SeasLog on GitHub](https://github.com/SeasX/SeasLog)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/seasx-seaslog
