Comments (5)
Record to log saved after exit the controller action. What exactly problem you want to solve? Notificate something about error?
from mongodb_logger.
I'm keeping a separate database of unique error conditions (if I have seen the error string before I just update the timestamp on the record, otherwise I save a new record) because the error logs were getting lost in the huge volume of normal logs. If I added the url to the mongo record to my new database, I would have not only a list of all outstanding issues, but a click link to the context that the error occurred in with all the other logs for that situation as well.
I suppose that the best thing might be for me to save the error logs in a session variable, and update them all when the mongo log is saved.
from mongodb_logger.
If I added the url to the mongo record to my new database, I would have not only a list of all outstanding issues, but a click link to the context that the error occurred in with all the other logs for that situation as well.
Ok, I understand. How about some callback? I can add in logger callback option, which will call some code on error. For example:
MongodbLogger.configure do |config|
config.on_error do |mongo_record|
# do something with this record
end
end
from mongodb_logger.
That would be fantastic, thanks!
from mongodb_logger.
Ok, I added such functionality:
MongodbLogger::Base.configure do |config|
config.on_log_exception do |mongo_record|
# do something with this data, for example - send email (better - by background job)
end
end
But here little problem - we have all data, except "_id". This is because we do insert without waiting response from MongoDB for maximum speed. I think this should help you. I already release version 0.2.8 with this functionality.
from mongodb_logger.
Related Issues (20)
- assets are not loaded in staging and production HOT 14
- Messages node is empty HOT 5
- Can't add metadata to logs! HOT 8
- Having trouble with setup on Heroku HOT 5
- Log messages (debug/info/warn etc.) don't show up HOT 8
- You do not use capped collection for logs HOT 3
- How to log message from Rails Console or Resque Jobs HOT 2
- How catch logs from some Rails::Engine's? HOT 16
- rake task to recreate capped collection when size is changed HOT 7
- Mongodb logger exception on server HOT 2
- Routing Errors not appearing in the logs HOT 4
- How to catch MOPED logs? HOT 3
- Not working with moped 2.0 beta/beta2 HOT 3
- Production logs not created when mongodb_logger can't connect HOT 10
- Uninitialized constant BSON HOT 8
- I Have error in Production: HOT 8
- Is is possible to get or record response status code? HOT 2
- Filter what to log to MongoDB HOT 1
- Mongoid 5.1 support HOT 1
- Rails 5 support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongodb_logger.