SUPPORT Email:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
+44 (0)7000 368457 SALES Email:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
+44 (0)7000 368537

Tick 42 Blog Latest

Simply put - it represents a real chance to have a single market data abstraction that clients can commit to, resulting in significant benefits arising from code reuse, reduced support and better tooling when compared to supporting the multiple platforms that many organ

“Error - Failed to connect”

From time to time I wear a support hat and usually one of the first things I say is “Send me the log files”. Log file messages are not usually quite as unhelpful but you can imagine my reaction when the only information in the file is a message like that.

I’m going to run through a few ideas that can make logging more effective, but one of the main points I want to make is that logging is not just for developers, its for support and production people too.

Tools like Log4Net and Log4J make it easy to add logging to code but generating the right log messages with useful information requires a bit of thought. When you are writing code, try to put yourself in the shoes of the person reading the log file when something has gone wrong.

So… “Error - Failed to connect” – Duh - Failed to connect to what? It’s obvious you need to insert some strings into the message including at least the host name and port but then there might be several things in the process trying to connect to something so it would make sense to identify what is doing the connecting. So a much better message might be something like “HeartbeatListener failed to connect to daemon on MyServer:7500” if that’s what it’s trying to connect to.

Then again, is it actually an error, does it stop the system from functioning correctly? Should it just be logged as a Warning? Maybe you can just be log it as Info. Suppose you have something trying to initiate a connection to several servers and you don’t actually care which succeeds, so long as one of them does. It’s important to get this right because log files are increasingly used as monitoring tools with anything from enterprise tools like splunk to a simple ‘tail –f output.log | grep Error | ….’

Monitoring systems will often email a lot of people if they detect something logged as ‘Error’ so your incorrect logging level can be very visible. Following on from that it’s a good idea to think about how many times you report an error, and consider the possibility of your system getting into a loop repeatedly logging an error and triggering emails all weekend. I know from bitter experience how hard it is to delete 45,000 messages from a Blackberry.

While they would clearly be better served using the Tick42 Metrics, developers sometimes choose to use logging to monitor system activity and performance and this is often left switched on in UAT and sometime production environments. That’s fine until things start going wrong and you have to start extracting the errors and warnings from hundreds of megabytes of log files to see the sequence of events that is of interest. The Log4X tools make it easy to work with multiple loggers, so, if you need to log each request your service receives and how long it took, put that in its own log file.

Log4X provides a lot of options for managing log files; you can specify maximum sizes or a daily rollover. If you are planning on a lot of log output, make sure the files are big enough. If you restart a service after a problem has occurred, its possible that all the clients reconnecting and requesting everything will cause a huge quantity of messages. The last thing you want is for all these messages to push the information that you need to investigate the problem over the end of your size limited log files.

Logging is one of those things that you don’t really think too much about until you suddenly find you really need it. This article just scratches the surface.

Comments

nice

I think it is so important to keep your pets cool. I think the tips that you offer here is so good. Great article herewww.sekai-esthetique.fr

·

johny

johny has not set their biography yet

User is currently offline

johny
Friday, 02 November 2012

nice

I think it is so important to keep your pets cool. I think the tips that you offer here is so good. Great article herewww.sekai-esthetique.fr

·

johny

johny has not set their biography yet

User is currently offline

johny
Friday, 02 November 2012

nice

I think it is so important to keep your pets cool. I think the tips that you offer here is so good. Great article herewww.easy-conseil.net/entreprises">http://www.easy-conseil.net/entreprises]www.easy-conseil.net/entreprises[/url]

effective blog

I’m pleased. Very useful and effective blog site website does exactly what it locations out to do. I’ll secure your website web page for future use. http://www.nectarclaims.co.uk

·

King Greenlaw

King Greenlaw has not set their biography yet

User is currently offline

King Greenlaw
Thursday, 15 January 2015

Error - Failed to connect

Finally, if you require Triple a score high end Prada carriers for exploring, you need to locate a efficient supplier. Presently, most people opt to Omega Replica uk purchase carriers from on-line outlets. There are a lot of advantages for those to order Prada carriers from on-line outlets. Firstly, getting identical from on-line outlets is easy. Your Cartier Repilica Watches will be delivered to your home only after a few presses of the mouse button. The second thing is, internet vendors supply you with the best Omega Replica competitive prices. Finally, online outlets normally have the most significant variety of carriers to provide your Breitling Replica flavour and funds. Fourthly, remember to read through fashion magazines to know what have been in design and style, which assists you stay way from http://scotss.org.uk/pages/index.htm remaining embarrassed about out-of-time developments and style.">http://devonbybike.co.uk/home.htm]Omega Replica uk[/url] purchase carriers from on-line outlets. There are a lot of advantages for those to order Prada carriers from on-line outlets. Firstly, getting identical from on-line outlets is easy. Your Cartier Repilica Watches will be delivered to your home only after a few presses of the mouse button. The second thing is, internet vendors supply you with the best Omega Replica competitive prices. Finally, online outlets normally have the most significant variety of carriers to provide your Breitling Replica flavour and funds. Fourthly, remember to read through fashion magazines to know what have been in design and style, which assists you stay way from http://scotss.org.uk/pages/index.htm remaining embarrassed about out-of-time developments and style.