Replies: 2 comments 4 replies
-
Something like: namespace App\Logs;
// use ...
class MyLog extends BaseLog {
protected $message = 'message of the log';
protected $level = 'info';
public function getContext($param1, $param2...) {
return [
'foo' => $param1,
'bar' => $param2,
// ...
];
}
}
////////////
\App\Logs\MyLog::log($param1, $param2...); Other solution: namespace App\Logs;
// use ...
class PostLog {
public function showed($param1, $param2)
{
$this->info('message', [...]);
}
public function deleted($param1, $param2)
{
$this->info('message', [...]);
}
} |
Beta Was this translation helpful? Give feedback.
4 replies
-
Would't Even though, there might be projects where this requirement comes up, I'd say that's a very narrow use case which can usually worked around by configuration. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Like requests, policies... it would be a good idea to add a new item for logs.
To refactor ours logs to several classes and then calling them.
We can do it by creating the classes in
App\Logs
namespace for example.But it will be better if you add a command named
make:log
. Is it?Beta Was this translation helpful? Give feedback.
All reactions