Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Dedicated 'logs' directory#122

S

Kirby should provide an ‘official’ root for logs.

Many plugins log stuff and it would be nice to have a dedicated directory for that, even if Kirby itself doesn’t write any data there. When used inside a plugin, a Logger class/utility (maybe like @bvdputte‘s kirbylog?) could write to a folder named after the plugin.

Some plugins place their logs inside site anyway - so if I configured it to be somewhere else, all plugins using this core feature would follow this decision rather than writing to a hardcoded destination.

4 years ago
S

While we’re at it: exposing an after hook we could let people hook into it and implement their own solutions , like sending it to a mail address, saving to database etc - for Kirby being file-based first, writing files to a dedicated directory should suffice!

4 years ago
S

See this forum thread

4 years ago

Trying to read the room here: would site/logs/ be the one preferred commonly? @S1SYPHOS @Bart Vandeputte

4 years ago
1

@Nico , for my plugin I choose not to pick site/logs since it looked so “generic” and could clash with other devs already using that location. Now it seems some devs would really like to have it there, so I’ll just make it an option in my plugin.

The default will continue to be in site/kirbylogs to avoid breaking existing installations.

4 years ago

As stated in the forum thread about this, I’ld only see value in a logger being added to core if core itself has options to log things. IIRC core now uses the default php error log in case of errors and when debug: false in config. No other things can be logged.

Nonetheless, core provides hooks, so with my little logger plugin you could use these to have logs of the things you want/need.

4 years ago

PS; there are other log plugins as well. Eg bnomei has a more advanced one. One of the advantages of having this as a plugin is that ppl can choose what kind of logger they want.

I do get that the logs location should be configurable.

4 years ago
S

@Nico Answering your question: yes, I am all for site/logs.

While having a core logging feature is another but closely related topic, I am also in favour of this, but you are right, it is a separate concern.

4 years ago
Changed the status to
Completed
4 years ago
1
?

Thanks to all for your support of this idea!

4 years ago

@Nico I noticed you tagged it “Completed”. Where can we “see” this?

4 years ago

@Bart Vandeputte in an upcoming release. We’ll rename the label to make it clearer

4 years ago
Changed the status to
In upcoming releases
4 years ago
S

That was fast. Thanks everyone!

4 years ago
Locked this conversation
4 years ago
Changed the status to
Completed
3 years ago