- What is maalls/dblog-bundle used for?
- maalls/dblog-bundle is a Symfony bundle that integrates the DBLib logging library so applications can write structured log entries directly to a database. It routes Monolog-style records through Doctrine DBAL connections instead of flat files, making logs queryable and easy to correlate with application data. Typical uses include auditing, debugging distributed setups, and building admin dashboards over log history.
- Does maalls/dblog-bundle work with Laravel?
- No, it is a Symfony bundle rather than a Laravel package. It does not ship a Laravel service provider or Laravel-specific configuration, so using it in Laravel would require manual integration or wrapping DBLib yourself. For Laravel applications, a Laravel-native logging channel or a custom Monolog handler is usually a better fit.
- How do I install maalls/dblog-bundle?
- Install it with Composer using composer require maalls/dblog-bundle. In a Symfony application, register the bundle in config/bundles.php if Flex does not do it automatically, then add the bundle configuration for your database handler and log table. Because documentation is sparse, check the package source and README for the exact configuration keys before relying on defaults.
- How do I configure database logging with Doctrine DBAL in Symfony?
- The bundle wires up services and configuration so you can define database handlers, choose log tables, and control which channels or levels are persisted. You will typically point it at a Doctrine DBAL connection and provide the table details used by DBLib. Verify the expected schema and configuration structure against the package source, since the available documentation is limited.
- Which Symfony versions does maalls/dblog-bundle support?
- The overview does not provide an explicit Symfony version matrix, and the package has minimal adoption and sparse documentation. Check the composer.json constraints in the repository and test the bundle against your Symfony version before adopting it. This is especially important if you are on a recent Symfony release.
- Can I filter logs by channel or log level?
- Yes, the bundle is described as supporting configurable channels and log levels. You can control which channels or levels are persisted rather than writing every record to the database. Confirm the exact configuration syntax in the package source, because detailed examples are not well documented.
- Does maalls/dblog-bundle use Doctrine DBAL connections?
- Yes, it routes log records through Doctrine DBAL connections and integrates with Symfony's service container. That lets you reuse existing database connections and keep log writes within your Doctrine configuration. You still need to ensure the target log table exists and is indexed appropriately for your query patterns.
- How should I test database logging without polluting production data?
- Use a dedicated test database or connection and wrap tests in transactions that roll back after each run. You can also disable the database handler in test environments or route it to a separate log table. Assert that expected records are written for the channels and levels you configured.
- Is maalls/dblog-bundle production ready?
- The package has minimal adoption and sparse documentation, so treat it as a higher-risk dependency and review the code before production use. Verify compatibility with your Symfony and Doctrine versions, confirm the log table schema, and plan for indexing, retention, and volume growth. For critical auditing, consider a more actively maintained logging solution or a custom handler.
- What are alternatives to maalls/dblog-bundle for database logging?
- Alternatives include a custom Monolog handler that writes through Doctrine DBAL, Laravel's database logging channel for Laravel projects, or managed logging services such as Sentry or Elasticsearch-backed stacks. If you only need queryable application logs, building a small handler around your existing DBAL connection can be simpler than adopting a low-adoption bundle. Evaluate maintenance, schema control, and Symfony version support before choosing.