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

Rails tagged logger #143

Open
arr-dev opened this issue Jul 5, 2013 · 0 comments
Open

Rails tagged logger #143

arr-dev opened this issue Jul 5, 2013 · 0 comments

Comments

@arr-dev
Copy link

arr-dev commented Jul 5, 2013

We are using rails tagged logger to log Doorkeeper OAuth token information.

# config/application.rb
config.log_tags =.[
  :uuid,
  lambda do
   # get token somehow
    "#{token.id}-#{token.application.id}"
  end
]

Example log output line:
[4c7b23acf92ecf0e6be95cb9053dbe15] [9-3]

Format is setup as per wiki instructions:

class MyCustomLog < RequestLogAnalyzer::FileFormat::Rails3
  line_definition :log_tags do |line|
    line.regexp = /^\[\w*\] \[(\d*)\-(\d*)\]\s*$/

    line.captures <<
      { :name => :token, :type => :integer } <<
      { :name => :app, :type => :integer } 
  end

  report(:append) do |analyze|
    analyze.frequency :token, :title => "OAuth Token", :line_type => :log_tags
    analyze.frequency :app, :title => "OAuth Application", :line_type => :log_tags
  end
end

Still in the output I get "None found." for both of my analizers.

I do get "Parsable lines were encountered without a header line before it." error with this regex, but even if I use some other line, like "Completed" I don't get warnings, but also "None found".

I've checked regex with rubular, even tried hardcoding the values, but without luck.

Can someone nudge me in the right direction?

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

No branches or pull requests

1 participant