PHPackages                             lendable/form-error-log-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. lendable/form-error-log-bundle

AbandonedArchivedSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

lendable/form-error-log-bundle
==============================

Log form errors

v2.0.0(8y ago)06.5k↓50%1MITPHPPHP &gt;=5.5

Since Jan 13Pushed 2y ago3 watchersCompare

[ Source](https://github.com/Lendable/OhFormErrorLogBundle)[ Packagist](https://packagist.org/packages/lendable/form-error-log-bundle)[ Docs](https://github.com/ollieLtd/OhFormErrorLogBundle)[ RSS](/packages/lendable-form-error-log-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (20)Used By (0)

OhFormErrorLogBundle
====================

[](#ohformerrorlogbundle)

Log form errors.

Functional testing your forms is all well and good, but how do you know your users are using it correctly? This plugin can log the errors your users are making so that you can spot any usability problems.

WARNING: If the error is on the whole form this bundle tries to json\_encode your bound entity. If it can't be json\_encoded it will try to serialize before finally logging the whole \_POST request for the form. THIS IS A SECURITY RISK IF USED ON FORMS CONTAINING SENSITIVE DATA, LIKE PASSWORDS OR CREDIT CARD INFORMATION. If this is the case, you should implement the Serializeable or JsonSerializable (PHP 5.4) interfaces on your bound objects to block out the sensitive data.

Installation
------------

[](#installation)

This bundle is alpha stability due to the lack of testing on different form types.

Install this bundle as usual by adding to composer.json:

```
"lendable/form-error-log-bundle": "~1.0"

```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Oh\FormErrorLogBundle\OhFormErrorLogBundle(),
    );
}

```

Set up
------

[](#set-up)

There are 2 logging methods provided. One uses your normal logger (Monolog) and the other logs into a database

Method 1: Monolog
-----------------

[](#method-1-monolog)

You will need to create a new channel in your monolog settings called 'formerror'

```
#app/config/config_prod.yml
monolog:
	handlers:
		main:
			type:         fingers_crossed
			action_level: error
			handler:      nested
		nested:
			type:  stream
			path:  %kernel.logs_dir%/%kernel.environment%.log
			level: debug
		formerror:
			type:  stream
			path:  %kernel.logs_dir%/form-error-%kernel.environment%.log
			channels: formerror

```

Method 2: Database
------------------

[](#method-2-database)

This uses Doctrine. You should create your own Entity which implements FormErrorLogEntityInterface

```
