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

logger_level at NONE cliupdate.php issues DEBUG output #1077

Closed
PresGas opened this issue Jan 21, 2019 · 10 comments
Closed

logger_level at NONE cliupdate.php issues DEBUG output #1077

PresGas opened this issue Jan 21, 2019 · 10 comments
Labels
Milestone

Comments

@PresGas
Copy link

PresGas commented Jan 21, 2019

I am hosting a selfoss 2.18 installation on nearlyfreespeech.net. When I set the logger_level to NONE, cron outputs for the cliupdate.php seem to default to DEBUG. All the other options for logger_level run at the appropriate levels.

My cron line is like so:

/usr/local/bin/php7.2 /home/public/cliupdate.php

Let me know if you need other info.

@jtojnar jtojnar added the bug label Jan 21, 2019
@jtojnar jtojnar added this to the 2.19 milestone Jan 21, 2019
@jtojnar
Copy link
Member

jtojnar commented Jan 21, 2019

Hmm, apparently Monolog uses a fallback handler when we do not add any handlers: https://github.com/Seldaek/monolog/blob/4d5b7e6ba1127789c7ff59d6f762298eaa29787f/src/Monolog/Logger.php#L294-L296

This is fixed in 2395a12, thank you for reporting this.

@PresGas
Copy link
Author

PresGas commented Jan 21, 2019

Awesome and thank you for the fast turnaround!

Any "rough" target dates for 2.19 release?

@jtojnar
Copy link
Member

jtojnar commented Jan 21, 2019

We are blocked on #1014 and I am not sure when I will have large enough time window to debug the two remaining issues so I am unable to give any time frame.

However, the development builds are usually more reliable than stable releases since they include many bug fixes; I would recommend you to just use https://bintray.com/fossar/selfoss/download_file?file_path=selfoss-2.19-a5841a5.zip

@jtojnar jtojnar closed this as completed Jan 21, 2019
@GutHib
Copy link

GutHib commented Mar 28, 2023

Oddly I'm seeing the same behavior with the latest stable version 2.19. Updated today, and the servers HD has been filling like crazy (caught it at 99% and a log file of 8 GB, even though logger_level is set to NONE).

Sample from the logs...

[2023-03-28 23:15:02] selfoss.DEBUG: set cookie on www.XXXXXXXX.com/news/ expiring in 2592000 seconds [2023-03-28 23:15:02] selfoss.DEBUG: session does not contain valid auth [2023-03-28 23:15:03] selfoss.DEBUG: Creating database connection {"dsn":"mysql:host=localhost; port=3306; dbname=XXXXXXXX_db"} [2023-03-28 23:15:03] selfoss.DEBUG: Establishing MySQL database connection [2023-03-28 23:15:03] selfoss.DEBUG: ---

Seems like more or less the entire feed content is ending up in the logs, too.

@jtojnar
Copy link
Member

jtojnar commented Mar 29, 2023

@GutHib just to double check, what do you see if you modify selfoss as follows:

--- a/src/common.php
+++ b/src/common.php
@@ -48,6 +48,7 @@ $f3->set('BASEDIR', BASEDIR);
 
 $configuration = new Configuration(__DIR__ . '/../config.ini', $_ENV);
 
+var_dump($configuration->loggerLevel, $configuration->debug);
 $f3->set('DEBUG', $configuration->debug);
 $f3->set('cache', $configuration->cache);
 

Do you have this line in your src/common.php?

selfoss/src/common.php

Lines 244 to 245 in 3858ad4

if ($configuration->loggerLevel === 'NONE') {
$handler = new NullHandler();

@GutHib
Copy link

GutHib commented Mar 29, 2023

  • Lines 244 & 245 are in place.
  • Changing the logging from "NONE" to "ERROR" will fix the problem.
  • With logging set to "NONE" and the extra var_dump line it will continue. Or do you want me to check if the content of the log file is any different?

@jtojnar
Copy link
Member

jtojnar commented Mar 29, 2023

With logging set to "NONE" and the extra var_dump line it will continue. Or do you want me to check if the content of the log file is any different?

var_dump line should print the values in the browser to make sure it is not being overridden somehow.

@GutHib
Copy link

GutHib commented Mar 29, 2023

The output is:

string(0) "" int(0)

...when set to "NONE". When set to "ERROR", it is:

string(5) "ERROR" int(0)

@GutHib
Copy link

GutHib commented Mar 29, 2023

Works now after putting 'NONE' in single quotes.

I noticed the same with the password, had to put it in (single) quotes after the update.

@jtojnar
Copy link
Member

jtojnar commented Mar 29, 2023

@GutHib Oh, I forgot this was an issue. That was fixed with ba93393.

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

No branches or pull requests

3 participants