Download the PHP package chameleon-m/phalcon-logger without Composer
On this page you can find all versions of the php package chameleon-m/phalcon-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chameleon-m/phalcon-logger
More information about chameleon-m/phalcon-logger
Files in chameleon-m/phalcon-logger
Informations about the package phalcon-logger
Logger
How to install
Using Composer (recommended)
Best way to install skeleton would be Composer, if you didn't install it
Run code in the terminal:
Using Git
First you need to clone the project, update vendors:
DB
For PostgreSQL:
psql -h <host> -d <database> -U <user_name> -p <port> -a -w -f tests/_data/dump.sql
Or run migration (use phalcon devtools):
phalcon migration run
Two methods are available:
POST /api/logs
POST /api/logs?queue=1
- push in queue (for save need run task php cli.php logs queue -v -t
)
The data in it is passed to json. For example:
POST curl -X POST -d '{"entity":"Event","entityId":1000,"date":"2017-12-12 12:12:12","userId":3,"action":"create","diff":{"before":"test1","after":"test2"}}' http://phalcon-logger.dev/api/logs
The date is passed in the Postgresql timestamp format.
GET /api/logs
Possible filters for the query:
- from - paired filter from to. Indicates the date on which the filtering starts.
- to - paired filter with from. Indicates the date the filtering ends.
- entity - the name of the entity.
- entityId - array with entity id.
- action - the name of the action.
- userId - array with user id.
The response is as follows:
GET curl -X GET http://phalcon-logger.dev/api/logs?page=3
Attribute - Description
items - The set of records to be displayed at the current page\ current - The current page\ before - The previous page to the current one\ next - The next page to the current one\ last - The last page in the set of records\ total_pages - The number of pages\ total_items - The number of items in the source data\
Testing
First you need to re-generate base classes for test all suites:
vendor/bin/codecept build
Once the database is created and base clases re-generated, run the tests on a terminal:
vendor/bin/codecept run
or for detailed output:
vendor/bin/codecept run --debug
Requirements
- PHP 7.0 and up
- Phalcon 3.2.0
- Composer
License
This project is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.
All versions of phalcon-logger with dependencies
ext-phalcon Version ^3.2
ext-json Version *
vlucas/phpdotenv Version ^2.4
dariuszp/cli-progress-bar Version ^1.0
php-amqplib/php-amqplib Version ^2.7