#logger not showing any request logs

69 messages · Page 1 of 1 (latest)

pliant quarryBOT
#

Project ID: dfa9f140-9408-44b8-927f-67fe0b663a57

surreal river
#

dfa9f140-9408-44b8-927f-67fe0b663a57

sonic lake
#

are you using gunicorn to run your app on railway?

surreal river
#

yea

sonic lake
#

i think you may need to enable access logs through gunicorn, i dont believe they are enabled by default

surreal river
#

im only accessing gunicorn through procfile:

web: gunicorn app:app

surreal river
#

so i need to have the logs print out to a seperate file first?

#

when i was using heroku, ik the req logs for the app would show by default

#

so tryna figure it out for here

sonic lake
#

you want to log to stdout

surreal river
#

hmm

#

how does railway read it

sonic lake
#

have you read the docs section i linked? it tells you exactly how to log access logs to stdout

surreal river
#

looking at it now

#

thx

#

--access-logfile '-'

sonic lake
#

yep

surreal river
#

ah so now i j gotta add all the logging manually i think

sonic lake
#

no? with that config flag gunicorn should print the access logs for you now

surreal river
#

yeah i thought so to but idt it was lemme check again

sonic lake
#

have you tried it on railway yet?

surreal river
#

yeah railway isnt showing any req logs

#

only the custom logging i have impleemnted

sonic lake
#

you have --access-logfile '-' in your procfile?

surreal river
#

yes sir. web: gunicorn app:app --access-logfile '-'

sonic lake
#

try without the single quotes

#

and try --log-level debug too

surreal river
#

oh wait im dumb, i was onlny updating the procfile in my codebase, not on railway smh

#

thought it read my procfile lol

sonic lake
#

youd need to push changes to github

surreal river
#

i did, the procfile i have is in the github but the railway procfile was showing as the default one

sonic lake
#

where are you viewing this "railway procfile"

surreal river
#

the start command

sonic lake
#

screenshot please

surreal river
sonic lake
#

its empty

#

as it should be

#

so where is this "railway procfile you speak of"

surreal river
#

it was not empty. i emptied it for the picture. it was orignally filled with "gunicorn app:app"

sonic lake
#

okay keep it empty

surreal river
#

and just use the procfile in the code base right?

sonic lake
#

yep

surreal river
#

idk why its not showing any sdout logs

web: gunicorn app:app --access-logfile '-' --log-level debug

tried with this and without the quotes

sonic lake
#

what does the build table at the top of the build logs say?

surreal river
#

oh shoot it worked

#

haha

sonic lake
#

🥳

surreal river
#

the [DEBUG] logs are railway correct?

#

in red

#

oh nvm

#

thats from procfile

#

tysm for ur help, just started using railway tn xD, so awesome

sonic lake
#

some loggers print to stderr when they should be printing to stdout, so railway highlights them as red

surreal river
#

gotcha yeah i removed the -debug which doesnt show now, j playing around w it

#

is there a way to clear the logs?

#

from Observability

sonic lake
#

haha no that would kind of defeat the purpose of that feature

surreal river
#

yeah true jw for previous logs

sonic lake
#

well the point of it is to observe logs from the past and future, so clearing it would kinda defeat that purpose

surreal river
#

yeah gotcha

sonic lake
surreal river
#

is replicas like the equivalent to dynos?

#

like # of threads taht will be ran

sonic lake
#

a replica is a clone / duplicate / replica of your service

#

you want 5 replicas, railway will spin up 5 duplicates of your service and round robin proxy incoming requests to those 5 duplicate services

surreal river
#

gotcha, so does it have anything to do w making the app faster, or it just creates replicas?

sonic lake
#

under high load adding more replicas would help to spread out the compute across multiple replicas, and not to gatekeep, but most hobby projects wont need any replicas