Heroku logs cluttered - heroku

I just started using Heroku for one of my node apps.
When I run the heroku logs command it is so cluttered that i cant pick out the data I want from all the other information I don't need.
Is there a way to clean up that log output so it's more human friendly?
It's like it just dumps a wall of text at me.
Thanks!

I am using Papertrail add-on on Heroku for viewing the logs.
It has a free plan which is enough for small application. It gives you flexibility for searching your logs by text and time. A browser URL is provided by Papertrail to view the logs, which is convenient to access from mobile also. Adding this add-on to your application is quite simple, no app changes are required. Below filters are available out of the box on its dashboard to view the logs-
All events
Deploys
Dyno state changes
Platform errors
Web app output

Related

Access to heroku logs without access to app itself

Say, i have a team of developers. I want them to have access to production logs, but nothing else. Preferably they shouldn't even know the heroku's internal app name.
How do i do that?
I don't think it's possible (at the moment) with Heroku command line. You have two options:
Use one of the logging addons and give your teammates access to the logging app only
Write yourself a log drain for Heroku logplex route the logs to AWS S3, your own DB or other, then give your teammates some way to view the logs.

Same add-on for multiple Heroku apps

What are the best practices with Heroku add-ons? I manage multiple Heroku apps. I want them to share a common add-on. how to do that?
For example, first I signed up for Mandrill on their website. When I added Mandrill add-on on Heroku, they created a new Mandril account for me. I wanted to merge them but Mandril support said that they can't merge accounts!
Another example, I added Logentries add-on to one Heroku app. A Logentries account was created. Then I added another Logentries add-on to another Heroku app, then another Logentries account was created.
It's getting messy. Am I doing it right? How to make several Heroku apps share one add-on account?
Sharing add-ons between apps is possible.
Once the add-on is added to one of the apps, an environment variable will be created containing the account information. You can copy the variable to other apps and they will start sharing the same 3rd party resource.
The add-on will remain listed only under the first app, where it was initially added, but this will not prevent the other apps to use it.
In the general case it isn't possible to share add-ons between Heroku apps. However with some specific add-ons this is possible, depending on the add-on.
For example with Logentries you can have one Logentries account and then configure each Heroku app to send its logs to Logentries via a syslog drain.
https://logentries.com/doc/heroku/ (See the "Alternatively: Point your syslog drain to Logentries" section)
To set up syslog drain, you have to create a new log in Logentries UI
with the source type “Syslog TCP, UDP” (select Hosts, then click on a
button in right top corner). Logentries will assign you a port number
PORT and set the log in discovery mode to match your log with source.
Then, let Heroku know where to send you log entries. Add a Heroku
syslog drain and point it at api.logentries.com:PORT:
heroku drains:add syslog://api.logentries.com:PORT
Yes, you're doing it right. Each Heroku app is a separate instance and will get its own add-ons. There is no way to share add-ons across multiple Heroku apps, as far as I know.

ElasticBeanstalk system events and my application logs

AWS has a really nice log management tool. I can make my application log messages there very easy.
Amazon ElasticBeanstalk has a "event management" tool.
The questions are:
Can I log my app messages together in the ElasticBeanstalk events? Is it the syslog of the EC2 instance?
If yes, is this a good practice? Any problem on this? I was thinking about because, if there is no problem, I would not need any other third log management service.
The events shown in Elastic Beanstalk are internal to it. You are not supposed to fudge around with them (Although nobody is really preventing you from playing around with them).
Also, there's a log snapshot feature that picks up logs related to the application. These logs are mainly related to deployment and logging messages from the application itself. So, you can use this feature in case your application code is logging messages. For example, if you are running a Ruby/Rails with passenger you would get log messages under /var/app/support/logs/passenger.log. These are not syslog messages per se and the problem with this approach is that it's not straight forward the get your custom monitoring in place. For example, how do you parse your errors and send them to say PagerDuty?
Like you've probably figured out if you want to have custom monitoring (send logs to a syslog facility) you are better off using a third party tool like Splunk Storm, PaperTrail or Loggly. Of course you can setup your own syslog server(s) but that will require you to set up all the infrastructure.
Hope this helps.

heroku file upload in php

I'm wondering for long period of time for making an app in facebook with heroku server. Actually my app dynamically generates image via php. But heroku wont allow allow me for image generation. Can some one explain me how to solve it or recommend any other free server like heroku?
I don't really know what your question is, since you didn't post any specifics or code samples, but I'm betting your issue is with Heroku having a read-only filesystem. If you want your app to be able to create/store/manipulate files, you should be using external storage. I use Amazon S3 with Heroku to store images for my Rails apps and it works great. Google "Heroku s3" and you should find a wealth of information.
More info on the filesystem restraints: https://devcenter.heroku.com/articles/read-only-filesystem

Heroku web UI log viewer

I wonder if there is a more friendly way ( using some GUI) to view Heroku application's logs than through a console?
I think papertrail (heroku addon) is the best option, it is similar to console logs, with search, and you can achive the logs daily to amazon S3.
Not at the moment.
You can however use the logs drain add-on to pipe your applications to a running syslog on a separate server, like outlined in the heroku docs.
After that, you could use a tool like Splunk to analyze your logs in a nice Web UI.
Hope this helps.
The Loggly Heroku add-on might be a good option.

Resources