FamilySearch / gedcomx-php

PHP SDK for GEDCOM X Processing. See the documentation at
http://familysearch.github.io/gedcomx-php/
Other
35 stars 15 forks source link

Ability to log with a PSR-3 compatible Logger #28

Closed jimmyz closed 9 years ago

jimmyz commented 9 years ago

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.

justincy commented 9 years ago

+1

justincy commented 9 years ago

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.