Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default setting log directory /log not works as written in documentation #557

Open
mildabre opened this issue Mar 9, 2023 · 4 comments
Open

Comments

@mildabre
Copy link

mildabre commented Mar 9, 2023

Hi

I have Tracy 2.10.0 in pure PHP project installed via composer into /vendor directory. Development server PHP 8.2 on Windows, Production server on PHP 8.1 on Linux. On both servers is this unexpected behaviour:

First I have created directory /log for logging errors and expected as stated in documentation, that Tracy will automatically use this directory in Production mode for logging.

Directories in root directory:

/app
/log
/stat
/templates
/vendor/tracy

Documentation (Czech) here: https://tracy.nette.org/cs/guide#toc-produkcni-rezim-a-logovani-chyb

Citation: "Pokud neurčíme jinak, půjde o soubor log/error.log." and "Jiný adresář pro logování chyb lze nastavit druhým parametrem metody enable():"

These citation from documentation unquestionably follows that directory /log is default one and there is no need to configure it in the method Debugger::enable() with the second parameter.

But the real behaviour of Tracy isnt like this. Exception in Production mode cannot be logged into the default directory and follows SERVER ERROR We're sorry! The server encountered..... + Tracy is unable to log error.

So you MUST configure the log directory in each case:

Debugger::enable(Debugger::Detect, $rootDir.'/log');

After than logging errors works.

Proposal

a) Keep described function in documentation

b) Repair the function of Tracy so that the default directory works automatically without setting with Debugger::enable()

c) I also submit for consideration - in case that directory /log doesnt exists Tracy will automatically create this one

@mildabre
Copy link
Author

mildabre commented Mar 9, 2023

Hi,

I have looked additionally into configuring Tracy in standard Bootstrap.php from nette/web-project skeleton, where is this code:

$configurator->enableTracy($appDir . '/log');

So I have deeply reconsidered my original proposal and I would like to change it:

a) let the function be as it is now

b) change the documentation and bring it into line with the real function - clearly define that log directory MUST be configured !!

Its up to you as experienced Nette leader which solution would be the best and in line with the current trend in php web development. I personally thing that it is more precise have the definition in the code than some default value.

@dg
Copy link
Member

dg commented Mar 10, 2023

tl;Dr?

@JanTvrdik
Copy link
Contributor

tl;Dr?

Tracy documentation should be fixed to mention that user need to configure logging directory, otherwise logging will not work at all.

@dg
Copy link
Member

dg commented Mar 10, 2023

So please send PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants