# PearLogListener

Implements \BuildListener

Writes build messages to PEAR Log.

By default it will log to file in current directory w/ name 'phing.log'. You can customize this behavior by setting properties:

- pear.log.type
- pear.log.name
- pear.log.ident (note that this class changes ident to project name)
- pear.log.conf (note that array values are currently unsupported in Phing property files)

`phing -f build.xml -logger phing.listener.PearLogger -Dpear.log.type=file -Dpear.log.name=/path/to/log.log`

author | Hans Lellelid hans@xmpl.org
version | $Id: 0a48d7c56285aa21b0a50dbe6380a47f17600002 $
see |
package | phing.listener

### Methods

## Logs whether the build succeeded or failed, and any errors that occured during the build. Also outputs the total build-time.

    buildFinished(\BuildEvent $event)

see | \BuildEvent::getException()

### Arguments

#### $event

`\BuildEvent`

## Sets the start-time when the build started. Used for calculating the build-time.

    buildStarted(\BuildEvent $event)

### Arguments

#### $event

`\BuildEvent`

## Configure the logger.

    configureLogging()

## Get the configured PEAR logger to use.

    logger() : \Log

This method just ensures that logging has been configured and returns the configured logger.

### Response

`\Log`

## Logs a message to the configured PEAR logger.

    messageLogged(\BuildEvent $event)

see | \BuildEvent::getMessage()

### Arguments

#### $event

`\BuildEvent`

## Fired when a target has finished. We don't need specific action on this event. So the methods are empty.

    targetFinished(\BuildEvent $event)

see | \BuildEvent::getException()

### Arguments

#### $event

`\BuildEvent`

## Logs the current target name

    targetStarted(\BuildEvent $event)

see | \BuildEvent::getTarget()

### Arguments

#### $event

`\BuildEvent`

## Fired when a task has finished. We don't need specific action on this event. So the methods are empty.

    taskFinished(\BuildEvent $event)

see | \BuildEvent::getException()

### Arguments

#### $event

`\BuildEvent`

## Fired when a task is started. We don't need specific action on this event. So the methods are empty.

    taskStarted(\BuildEvent $event)

see | \BuildEvent::getTask()

### Arguments

#### $event

`\BuildEvent`

### Constants

## Size of the left column in output. The default char width is 12.

    LEFT_COLUMN_SIZE

var |

### Properties

## Time that the build started

    startTime : integer

var |

### Type(s)

`integer`

## Maps Phing Project::MSG_* constants to PEAR_LOG_* constants.

    levelMap : array

static

var |

### Type(s)

`array`

## Whether logging has been configured.

    logConfigured : boolean

var |

### Type(s)

`boolean`

## PEAR Log object.

    logger : \Log

var | PEAR Log object.

### Type(s)

`\Log`