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

Duplicate logging on 0.12.1 #1645

Closed
fgarcia opened this Issue Apr 4, 2014 · 7 comments

Comments

Projects
None yet
2 participants
@fgarcia

fgarcia commented Apr 4, 2014

After updating to Padrino 0.12.1 from 0.12.0 the logger sends duplicated lines:

Before a log message was like this:

DEBUG -       GET (0.0279s) /grosshandel - 200 OK

Now after the upgrade, I get the log duplicated with a different format:

DEBUG -       GET (0.0279s) /grosshandel - 200 OK
localhost - - [04/Apr/2014:15:19:18 CEST] "GET /grosshandel HTTP/1.1" 200 3520
http://localhost:3000/unternehmen -> /grosshandel

I am not sure if this will help to locate the problem, but I noticed that the extra logging line is also showing GET calls to the stylesheets, which were not rendered before.

@fgarcia fgarcia changed the title from Duplicate padrino logging on 0.12.1 to Duplicate logging on 0.12.1 Apr 4, 2014

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Apr 7, 2014

Member

The second line is not Padrino's doing. Please show the Gemfile.lock for the first case where there's only one line.

Member

ujifgc commented Apr 7, 2014

The second line is not Padrino's doing. Please show the Gemfile.lock for the first case where there's only one line.

@fgarcia

This comment has been minimized.

Show comment
Hide comment
@fgarcia

fgarcia Apr 7, 2014

I've created a repo with two Padrino projects: now (Padrino 0.12.1) and before (Padrino 0.12.0) where the only difference is the Gemfile version.

I also attached some screenshots along the generated lock file

fgarcia commented Apr 7, 2014

I've created a repo with two Padrino projects: now (Padrino 0.12.1) and before (Padrino 0.12.0) where the only difference is the Gemfile version.

I also attached some screenshots along the generated lock file

@ujifgc ujifgc added the bug label Apr 7, 2014

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Apr 7, 2014

Member

Yes, confirmed. padrino s is behaving differently.

Member

ujifgc commented Apr 7, 2014

Yes, confirmed. padrino s is behaving differently.

@ujifgc ujifgc closed this in f63724f Apr 7, 2014

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Apr 7, 2014

Member

Thank you for your report. I missed this bug because I use rackup and in that case there was no difference in log format.

Member

ujifgc commented Apr 7, 2014

Thank you for your report. I missed this bug because I use rackup and in that case there was no difference in log format.

@fgarcia

This comment has been minimized.

Show comment
Hide comment
@fgarcia

fgarcia Apr 8, 2014

that was fast!

I tested your fix in my sample repo. I can confirm that padrino s behaves back to normal.

However in my case, the funny thing is that I do get the same problem using rackup.

I did reproduce the rackup only problem and pushed the Gemfile change. This time, I am not forgetting the repo link for this bug report! 😅

https://github.com/fgarcia/bug-padrino-logs

fgarcia commented Apr 8, 2014

that was fast!

I tested your fix in my sample repo. I can confirm that padrino s behaves back to normal.

However in my case, the funny thing is that I do get the same problem using rackup.

I did reproduce the rackup only problem and pushed the Gemfile change. This time, I am not forgetting the repo link for this bug report! 😅

https://github.com/fgarcia/bug-padrino-logs

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Apr 8, 2014

Member

Unfortunately rackup server cannot be fixed without monkey-patching Rack. It provides no options to skip adding logging middleware in development environment: https://github.com/rack/rack/blob/15796c4a1529ac2ca756431d7e63394bf379f407/lib/rack/server.rb#L217

Monkey patch would be something like this:

module Rack
  class CommonLogger
    def call(env)
      # do nothing
      @app.call(env)
    end
  end
end

http://gromnitsky.blogspot.ru/2012/04/how-to-disable-rack-logging-in-sinatra.html

Member

ujifgc commented Apr 8, 2014

Unfortunately rackup server cannot be fixed without monkey-patching Rack. It provides no options to skip adding logging middleware in development environment: https://github.com/rack/rack/blob/15796c4a1529ac2ca756431d7e63394bf379f407/lib/rack/server.rb#L217

Monkey patch would be something like this:

module Rack
  class CommonLogger
    def call(env)
      # do nothing
      @app.call(env)
    end
  end
end

http://gromnitsky.blogspot.ru/2012/04/how-to-disable-rack-logging-in-sinatra.html

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc
Member

ujifgc commented Aug 6, 2014

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