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

Doesn't work in production #34

Closed
n-rodriguez opened this issue Aug 13, 2015 · 10 comments
Closed

Doesn't work in production #34

n-rodriguez opened this issue Aug 13, 2015 · 10 comments

Comments

@n-rodriguez
Copy link

Hi! Logster works in development but not on my production server.

The page is well displayed, Ajax call are made to refresh the view, but nothing appears...

Any idea?

@SamSaffron
Copy link
Member

it works :)

you just need to mount the viewer

See:

https://github.com/discourse/discourse/blob/master/config/routes.rb#L18-L24

and

https://github.com/discourse/discourse/blob/master/config/initializers/logster.rb

Would you mind doing a PR for documentation after you get it going ?

@n-rodriguez
Copy link
Author

Thanks for your answer. That's what I've done : https://github.com/jbox-web/deploy-it/blob/master/config/routes.rb#L24. Maybe should I try with an other constraint?

@SamSaffron
Copy link
Member

Keep in mind in prd we default to warning and up. Open a rails console and
log an error, you should see it.

On Friday, August 14, 2015, Nicolas notifications@github.com wrote:

Thanks for your answer. That's what I've done :
https://github.com/jbox-web/deploy-it/blob/master/config/routes.rb#L24.
Maybe should I try with an other constraint?


Reply to this email directly or view it on GitHub
#34 (comment).

@n-rodriguez
Copy link
Author

It works! Sorry for the noise. Very good gem 👍

By the way, can I use logster to monitor an other log file / logger?

@SamSaffron
Copy link
Member

Sure, you can chain it to whatever, have a look at the test suite it should
clarify a lot of the apis.

On Fri, Aug 14, 2015 at 11:57 PM, Nicolas notifications@github.com wrote:

It works! Sorry for the noise. Very good gem [image: 👍]

By the way, can I use logster to monitor an other log file / logger?


Reply to this email directly or view it on GitHub
#34 (comment).

@bitsapien
Copy link
Contributor

bitsapien commented May 27, 2016

The log level in production.rb is set to :info, but I still see that my screen is blank. Only logs with level set to fatal show up. It works fine in development though.

@yhmiao
Copy link

yhmiao commented Feb 26, 2017

@bitsapien Have you worked out why it is showing in development but not production? I'm having the same issue and can't seem to figure out why.

@bitsapien
Copy link
Contributor

@yhmiao It works fine for me now. Check your logs dump on production to check whether you are getting any logs at all.

@nahankid
Copy link

nahankid commented Apr 18, 2024

Hi, I used Logster back in 2017 and love it. Using it again and it's working in dev but not prod or staging. While trying to troubleshoot it, I noticed two things:

  1. In the server logs I see that Logster is looking at different IPs. Is that normal?

Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 172.71.159.45 at 2024-04-18 04:52:18 +0000
Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 172.71.159.46 at 2024-04-18 04:52:30 +0000
Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 172.71.159.45 at 2024-04-18 04:52:36 +0000
Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 172.71.154.236 at 2024-04-18 04:53:15 +0000
Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 172.71.154.194 at 2024-04-18 04:53:54 +0000
Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 172.69.135.149 at 2024-04-18 04:54:33 +0000
Started GET "/logs/messages.json?filter=0_1_2_3_4_5" for 162.158.166.226 at 2024-04-18 04:55:12 +0000

  1. In dev, redis has many "logster-env-*" keys but none in staging.

What am I doing wrong?

Btw, the rails version is 4.2.9 (same app from 2017). I have this in Logster initializer:

Logster.set_environments(%i[local development qa staging production])
Logster.store = Logster::RedisStore.new

Thanks in advance!

@zealot128
Copy link

I was also puzzled after seeing no events on production. Only errors/warnings came after a while.

Then I discovered that Logster really does ignore info+debug calls:

store.level = Logger::Severity::WARN if Rails.env.production?

It seems to be disabled for a reason, but if you want to see info logs in prod, too, then you can change it in an initializer:

Logster.logger.store.level = 1

But then you will get the whole beauty of the Rails default logger with useless junk like "rendered in 0.2ms" with each line unrelated to the request etc. There might be more work needed to combine those.
Maybe using stuff like Lograge will help here, by combining everything in one line.
I also used tagged logging with request_id, but that had no effect on Logster, only on the standard production.log

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

No branches or pull requests

6 participants