GUI logs blank but /rails/production.log logging


#1

When I go to my discourse.domain.co.uk/logs URL I am presented with a blank page. The options for Warning, Info, Error & Fatal are all checked.

On my docker container when I browse to /var/discourse/shared/standalone/log/rails/production.log, I can see GET requests being completed OK and also an error had occurred.

GET showing 200:

Started GET "/latest.json?api_key=[FILTERED]&api_username=[FILTERED]" for [FILTERED] at 2018-05-08 08:42:26 +0000
Processing by ListController#latest as JSON
  Parameters: {"api_key"=>"[FILTERED]", "api_username"=>"[FILTERED]"}
Completed 200 OK in 28ms (Views: 0.1ms | ActiveRecord: 7.4ms)

POST showing error 422 (probably because a limit was reached):

Started POST "/posts?api_key=[FILTERED]&api_username=[FILTERED]" for [FILTERED] at 2018-05-08 08:42:27 +0000
Processing by PostsController#create as */*
  Parameters: {"api_key"=>"[FILTERED]", "api_username"=>"[FILTERED]"}
Can't verify CSRF token authenticity.
Completed 422 Unprocessable Entity in 6ms (Views: 0.2ms | ActiveRecord: 1.1ms)

Examples like above do not show under discourse.domain.co.uk/logs.

Is there somewhere where I need to enable logging via GUI and not just on the container? It’d be good to enable GUI logging for developers to troubelshoot when making API calls.

Setup:

AWS Centos Image
Docker
t2.medium
HTTPS enabled with force option

Kind regards,
Amoncadot


(Bhanu Sharma) #2

Have you installed any plugins?


#3

Hi Bhanu,

The only plugins I have are in the following app.yml:

Default: git clone https://github.com/discourse/docker_manager.git app.yml
Custom: git clone https://2********************@github.com/domain/discourse-plugin-1.git 

The custom plugin is just a private repo of the Discourse Characters Required plugin on Git as I was testing the Git API token integration with Discourse.

So only those two plugins are running.


(Bhanu Sharma) #4

Can you rebuild with that custom plugin disabled?


#5

Hi Bhanu,

I rebuilt without the custom plugin and still see no logs.

Where is the configuration to write logging to the GUI logs?


(Bhanu Sharma) #6

I didn’t really understood your concern. If you’re not having any logs in the your.domain/logs directory it means that there are no errors being thrown by your front end application.

the production.log logs the ruby actions.

if You want ruby logs in the your.domain/logs I’m afraid there is no way to do it.


#7

“the production.log logs the ruby actions.”

So am I correct in saying that the production.log file does not log what goes under your.domain/logs?

My concern is when I go to your.domain/logs it is blank and I presume that what you see under production.log should also show at your.domain/logs. Is that the case?


(Bhanu Sharma) #8

I’m not very much informed either so I’m speaking of my experience.
The things that show up in the /logs are mostly javascript and api related and mostly log something when there is something wrong in the UI.

Ruby on the other hand handles the backend, the tasks that happen silently in the background when someone creates a topic, replies, likes etc. There are things that are visible and some things that happen in the background such as triggers for notifications, emails etc. All these ate triggered from the backend so the functions are happening in ruby which is not actually the front end. Ruby logs contain a lot of stuff that can scare a normal person if they are not well informed of the difference between actions and errors.

About the inclusion of ruby logs, that is totally a choice of the core team but I think it is pretty okay not to scare people when they shouldn’t be scared.


(Sam Saffron) #9

All production logs that are warning and up show up in the GUI, info level only shows in the file


(george.thomson) #10

I am currently having this same problem. I have an instance running (built following the Docker install instructions, running on AWS) and the log UI does not show any logs, with all levels checked. My dev instance (built using the Virtual Box instructions, running in a VB locally) shows logs happening all the time, at least at the lower log levels (queries, message deliveries, etc) but the “production” instance is completely blank.

Is there a setting or config that controls logs showing in the UI? I could not find anything but I am not ruling out missing something obvious.

I am trying to track down why something works in my plugin on the dev instance but not on the production instance and was hoping to rely on the logging to find the problem.