Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

25 Commits

Repository files navigation

Simple data logging

Package versionPackage versionPHP versionLicense

The library contains a simple class, and it's facade, for simple data and exception logging on JSON format.

Installing

composer require hopex/simplog

Documentation

MethodsDescriptionExample for usage
setWorkDirectorySpecifies the root directory of the hierarchy of logging levels. It can take several directories in turn one after the other in the form of a standard path.setWorkDirectory('logging')
setWorkDirectory('logging/sub-folder')
setLevelSpecifies the name of the directory where you want to save the logging file. It can't take several directories in turn one after the other in the form of a standard path.setLevel('requests')
setTimeZoneSpecifies the current timezone.setTimeZone('UTC')
setTimeZone('Europe/Amsterdam')
setDateFormatSets the time format in the main key of one log element in the logging file. Will not be used if V is specified.setDateFormat('H:i:s')
setDateFormat('(Y) H:i:s')
setItemKeySets the primary key of one log element in the logging file. In this case, the current time will not be indicated.setItemKey('custom-key')
setItemsLimitSets the maximum number of elements in a single logging file. The value must be greater than zero. By default, 1000 keys.setItemsLimit(10)
setItemsLimit(5000)
setPermissionsSets access rights to the logging file.setLogFilePermissions(0755)
setLogFilePermissions(644)
setFileNameSets the name of the logging file.setFileName('my-requests-logs')
errorLogging any object as an error message.Similarly as for custom.
warningLogging any object as a warning.Similarly as for custom.
infoLogging of any object as an informational message.Similarly as for custom.
customLogging of any object.custom(new SomeClass())
custom('Some message')
custom(['key' => 'value'])
exceptionLogging of the exception object with the possibility of adding additional keys.exception(new \Exceptions())
exception(new \Exceptions(), true)
exception(new \Exceptions(), false, ['key' => 'value'])
clearLevelThe requirement to clear the directory where the logging file should be saved from other files.clearLevel()

About

The library contains a simple class and it's facade, for simple data and exception logging.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages