aungwinthant / apilogger

Small laravel package for viewing api logs which can be used in debugging.
MIT License
346 stars 61 forks source link

Log file date format #4

Closed mikeerickson closed 4 years ago

mikeerickson commented 4 years ago

I am looking for a way to customize the date format in API log files? I checked the apilog.php file but doesn't exist.

Personally, I would like to have same format used by Laravel logs

Eg.

apilogger-2019-08-08.log

or, better yet in my desired format

api-2019-08-08.log

Possible config entry

<?php

return [
    //currently supported drivers are 'db' and 'file'
    "driver" => "file",
    "filename" => "api-yyyy-mm-dd.log"
];

Thinking of a quick change to FileLogger.php:61

   $filename = 'api-'.date('Y-m-d') . '.log';

If you are interested, I would be happy to make a PR for this (unless you already have plans for this capability).

aungwinthant commented 4 years ago

Sure. Please make a PR and I will include this in coming release. Thank you for your feedback and contribution.

mikeerickson commented 4 years ago

Please see PR https://github.com/aungwinthant/apilogger/pull/19

Let me know if you have any questions / changes