Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make `thin` webserver print log to STDOUT

Context: To run localhost as SSL, I followed the instructions at this site

After setting up the SSL cert, to run the local rails server, the site says to:

thin start --ssl <some more options>

When I do that, I notice that I no longer see the Rails log being printed to STDOUT.

How can I pass the --ssl and other options to thin ? This does not work:

bundle exec rails s thin --ssl

.../rails/commands/server.rb:33:in `parse!': 
    invalid option: --ssl (OptionParser::InvalidOption)

Alternatively, how can I get thin to output the Rails log to STDOUT?

like image 836
Zabba Avatar asked Oct 17 '13 21:10

Zabba


People also ask

How to get the printing logs from a printer server?

As far as I know, there are no other built-in methods to get the printing logs on a printer server, except for printing service log in the event viewer. Maybe, there is third party tool which could be working, but it will be not supported by Microsoft. Please remember to mark the replies as answers if they help.

How to write logs to a file and stdout in Python?

This tutorial will introduce the methods to write logs to a file and stdout in Python. If we want to print our logs to the console window and write the logs inside a file, we can use the logging.basicConfig () function for this process. The logging.basicConfig () function configures some basic parameters for logging in Python.

How do I view print logs on Windows 10?

2. Expand “Applications and Services Logs,” “Microsoft.” “Windows” and “PrintService.” 3. Right click the “Operational” log to enable log. Alternatively, you can enable “Keep printed documents” on the printers, then you would see the files from c:\windows\system32\spool\PRINTERS .

How to use event viewer to check print logs?

Please make sure that you have enabled Operational log for printing if you want to use event viewer to check print logs. 1. Open event viewer. 2. Expand “Applications and Services Logs,” “Microsoft.” “Windows” and “PrintService.” 3. Right click the “Operational” log to enable log.


1 Answers

Well Thin explicitly does not log anything by default unless you specify it do so by passing options

-D or --debug and -V or --trace 

But having said that this would only track the request / response header of but not rails specific log since your are booting the rails as a rack app perhaps

I guess you need to start rails in ssl mode you can find couple of documentation over here and here

FYI to use thin as backend adapter in rails all you do is add gem 'thin' to the Gemfile and start rails it would start rails using thin adapter but you cant pass thin options like you do for when starting thin

like image 84
Viren Avatar answered Sep 28 '22 06:09

Viren