Log file readability

Hi, thanks anyway, but it didnā€™t work for me. After doing as you suggested (in the nextcloud/apps directory) and fixing permissions and SE linux settings I could no longer go to the Admin page when logged into my Nextcloud instance. Replacing the original folder make it work again.

Guess Iā€™ll just wait for 11.0.2.

Hmm, that is interesting. Maybe the most current master includes some new bug? I will try that by myself later.

to be clear, I have a running nextcloud version 11.0.1 then tried to swap out the logreader folder inside apps folder which caused me to not be able to load the Admin page at all (was just blank).

@lamixer Ha yeah, the current master has some bug, I am facing the same problem while trying to use it: Admin panel does not open with nextcloud 11.0.1, php 7.0 and apache 2.4.25.

After switching to stable11 branch, which is working as desired with table header bug fixed, I found the following error:

Error PHP Interface ā€˜OCP\Settings\IIconSectionā€™ not found at /var/www/owncloud/apps/logreader/lib/Settings/Section.php#28

@icewind Should be easily able to fix it, or is the current master just for nc 12 without backwards compatibility?


So the steps to get the table header bug fixed for nc 11 at the moment are:

$ wget https://github.com/nextcloud/logreader/archive/stable11.zip
$ unzip stable11.zip
$ mv logreader logreader-bak (just in case)
$ mv logreader-stable11 logreader

master is only for nc12, important fixed will be backported to stable11 (stable11 should work on nc10 to)

thanks, that worked. had to reload the page a second time before I saw the change.

Hello, Which external tools do you use for analysing the LOG ?
i am more non-IT person, and my NextCloud is not working so i cannot use the log reader inside NC .
pleas help.
i do not know why my first message was hidden by system.

hello Nick,
I do not know why my first message was hidden so i write again : it was trying to say : how the hack i may use the NextCloud log reader when my NextClloud is OFF (not working after update try) and i need to read the log ?

tail -f /var/log/apache2/error.log

1 Like

Wow, its quite shocking to see the developersā€™ attitudes towards logging the lack of understanding and support given to those that need to interpret these logs.

For those that need help, hereā€™s what Iā€™ve found.

There is a useful log in (debian location) /var/www/html/data/nextcloud.log or /var/html/data/nextcloud/data/nextcloud.log

To make things more fun, the devs didnā€™t simply save logs. No no, they store the logs in JSON format. So youā€™ll get a really hard to read format of text returned if you tail the log file.

I get why they chose to do this. But pointing someone to a web based log reader, when the web interface is down, is just counter productive.

After some googling, I found that one can post process the file after tailing it. This makes it human readable.

tail -f /var/www/html/data/nextcloud.log | jq

If you get an error about jq being missing, just install it from the apt repo with sudo apt install jq

5 Likes

Logs being per default saved in data folder, or you can configure different location of it. Please check config file under your installation config/config.php.

'datadirectory' => '/var/www/nextcloud/data',

https://docs.nextcloud.com/server/19/admin_manual/configuration_server/config_sample_php_parameters.html#default-parameters

and

'logfile' => '/var/log/nextcloud.log',

https://docs.nextcloud.com/server/19/admin_manual/configuration_server/config_sample_php_parameters.html#logging

jq is not part of many installations, try json_pp instead. E.g.:

tail -f /var/www/html/data/nextcloud.log | json_pp
1 Like

do you think itā€™s the right way addressing someone/your problems/your insights?

Remember we keep friendly while talking to others or about others. Plus: whereā€™s the additional benefit of what you wrote?

On a third point: you donā€™t need to crosspost stuff. --> Internal server error, where is the log?

Next time Iā€™d need to tell you to stay polite or such itā€™ll earn you an ā€œoffical warningā€.

Thanks for your attention.

3 Likes

Since it took me about two hours to format a lengthy excerpt of the error log from my installation for enhanced readability, redact sensitive information, and take advantage of the text formatting provided software by the behind the forum, I suspect that my workflow could be drastically improved. So it would be nice to have a way for users to effectively do all of this. Any suggestions?

tail -f /var/www/html/data/nextcloud.log | json_pp

Doesnā€™t work.

tail -f /var/www/html/data/nextcloud.log | jq

works just fine and is just an apt install away

2 Likes

I would not say that it does not work, on Ubuntu (that Iā€™m using) json_pp is part of perl module, that is usually installed per default, jq you need to install additionally. Of course both could be installed if not presented.

Yes, unfortunately jq is not installed and json_pp give this error:

cat data/nextcloud.log | json_pp
garbage after JSON object, at character offset 459 (before "ā€œreqIdā€:ā€œY2F3iauHi-gā€¦ā€) at /usr/bin/json_pp line 59.

So how can I view the log file?

apt install jq

@Sanook Without root access of course!

works for me - thanks

An arguably better solution than using just jq (which is great) is these two in combination: Is there any way to make the logfile more readable? - #6 by PancakeConnaisseur and Is there any way to make the logfile more readable? - #8 by meonkeys