FamilySearch/gedcomx-php

Ability to log with a PSR-3 compatible Logger

Closed this issue · 2 comments

Today, the gedcomx-php library has a dependency on the apache/log4php package. I propose that we remove that dependency in favor of the ability to simply pass the client a logger object that conforms to the PSR-3 specification.

Thus, the user of this package should be able to use a different logging library such as Monolog.

The client should implement to the LoggerAwareInterface as specified in PSR-3.

The client should log events according to log levels (emergency, alert, critical, error, etc.). I propose the following actions for the various log levels.

alert: API returns 503 System Unavailable errors
critical: API returns >500 errors
error: 40x and other type of errors
warning: logs warning headers returned by API
notice:
info: logs the URI of calls being made
debug: logs the request and response headers of requests

Please provide feedback on this proposal.

+1

Technically this would be a breaking change, though it's unlikely that anybody would be using the current logging system by setting the undocumented ENABLE_LOG4PHP_LOGGING_ENV_NAME environment variable.