Skip to content

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

@mildabre

Description

@mildabre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions