<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>kahunaburger &#187; AIR</title> <atom:link href="http://www.kahunaburger.com/category/air/feed/" rel="self" type="application/rss+xml" /><link>http://www.kahunaburger.com</link> <description>home of pia, max, frisco and tobias</description> <lastBuildDate>Wed, 08 Feb 2012 16:20:09 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>AirLog</title><link>http://www.kahunaburger.com/2009/03/25/airlog/</link> <comments>http://www.kahunaburger.com/2009/03/25/airlog/#comments</comments> <pubDate>Wed, 25 Mar 2009 12:26:06 +0000</pubDate> <dc:creator>Tobias</dc:creator> <category><![CDATA[AIR]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[Photo]]></category> <guid
isPermaLink="false">http://www.kahunaburger.com/?p=1363</guid> <description><![CDATA[[ this is a repost of an old article, because for some reason the old one got all messed up and I have no idea why ] Things were so simple in the old days, when we had a single server acting as web-/application-server at the same time. In order to see what was going [...]]]></description> <content:encoded><![CDATA[<p><em>[ this is a repost of an old article, because for some reason the old one got all messed up and I have no idea why ]</em></p><p>Things were so simple in the old days, when we had a single server acting as web-/application-server at the same time. In order to see what was going on, one would just &#8220;tail&#8221; the servers log-file (for example Apache&#8217;s access_log and/or error_log) to get live information about the servers activity.</p><p>Things are not as easy these days. For one of my work projects only god knows how many individual servers are involved: web-server, application server, rendering server, conversion server, etc. To see activity on all systems involved, developers usually have multiple Terminal windows open, are logged in to multiple servers and &#8220;tail -f&#8221; logfiles in those windows. While this allows people to get a live view into the system, it makes it very difficult to correlate log-events on one system to log-events on another system. The logs are tailed independently and the information is not &#8220;interleaved&#8221;.</p><p>There are existing utilities out there that allow you to look at multiple files at the same time (most notably <a
href="http://www.vanheusden.com/multitail/">http://www.vanheusden.com/multitail/</a>), but as far as I know, there is no platform-independent one.</p><p
style="text-align: center"><img
src="http://www.kahunaburger.com/wp-content/uploads/2007/12/airlog.jpg" alt="airlog" /></p><p><span
id="more-1363"></span></p><h3>Solution</h3><p>I created an <a
href="http://www.adobe.com/go/air">AIR </a>application that allows connecting to multiple servers at the same time, listening on multiple log-files (local or remote) at the same time, color-coding information from individual log-files and interleaving the information into a single log-display.</p><p>The solution consists of two pieces: the multitail-server and the AIR client. You can skip the portion about the &#8220;Multitail server&#8221; if you only want to listen on local log files</p><h4><a
title="AirLog-Multitailserver" name="AirLog-Multitailserver"></a>Multitail server</h4><p>The first step is to identify all hosts that have valuable log-information and to expose all those logs via a tcp-socket. On a typical modern Linux system, I made the following modifications:</p><h5><a
title="AirLog-1.)/etc/services" name="AirLog-1.)/etc/services"></a>1.) /etc/services</h5><p>I added a new service called &#8220;multitail&#8221; to the /etc/services file using a non-privileged, unused port number:</p><pre class="code-java">multitail     20000/tcp</pre><h5><a
title="AirLog-2.)xinetd" name="AirLog-2.)xinetd"></a>2.) xinetd</h5><p>Our Linux servers run xinetd and I added the following file as /etc/xinted.d/multitail:</p><pre class="code-java">service multitail
{
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/local/bin/multitail
}</pre><p>Unix systems running the traditional inetd can also be modified by adding a line to /etc/inetd.conf (not shown here).</p><h5><a
title="AirLog-3.)multitailserver" name="AirLog-3.)multitailserver"></a>3.) multitail server</h5><p>After that I created the server-program (/usr/local/bin/multitail in this case) that would be executed whenever a client makes a connection to port 20000 on the particular system:</p><pre class="code-java">#!/bin/sh
echo <span class="code-quote">"logfile=app:/</span><span class="code-keyword">var</span>/log/jboss/server.log"
echo <span class="code-quote">"logfile=web:/</span><span class="code-keyword">var</span>/log/apache/access_log"
echo "logfile=err:/var/log/apache/error_log"
tail -f /<span class="code-keyword">var</span>/log/jboss/server.log /<span class="code-keyword">var</span>/log/apache/access_log /var/log/apache/error_log</pre><p>The &#8220;logfile&#8221; lines announce which log-files are being served by this instance of multitail. &#8220;app&#8221;, &#8220;web&#8221; and &#8220;err&#8221; are tags that allow the AIR application to classify the log-information that&#8217;s coming from this server instance.</p><p>After creating the /usr/local/bin/multitail file, make sure that it is executable by using &#8220;chmod +x&#8221; on it.</p><h5><a
title="AirLog-4.)SIGHUP" name="AirLog-4.)SIGHUP"></a>4.) SIGHUP</h5><p>Once the above steps are complete, make sure you send the xinetd (or inetd) process a SIGHUP (&#8220;kill -HUP &#8230;&#8221;) signal to make it reload it&#8217;s configuration and recognize the new server process.</p><h4><a
title="AirLog-AIRclient" name="AirLog-AIRclient"></a>AIR client</h4><p>The AIR client will establish a connection to the above multitail server and will parse information from the server process. In order to know which systems to connect to, an XML configuration file is used. The XML file is called &#8220;airlog.xml&#8221; and is located in the same directory where you installed the airlog-application. Let&#8217;s look at a simple example:</p><pre class="code-java">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span> ?&gt;
&lt;connections&gt;
 &lt;connection name=<span class="code-quote">"staging"</span>&gt;
 	&lt;host name=<span class="code-quote">"staging.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 &lt;/connection&gt;
&lt;/connections&gt;</pre><p>This XML-code creates a single connection called &#8220;staging&#8221;. In the AIR application UI you will find a Combo-box that lists all the defined connections and allows you to connect to one of them at a time. Based on the above XML file, you would find one entry in the Combo-box called &#8220;staging&#8221;. Upon selecting the entry and clicking on &#8220;connect&#8221;, the AIR application will make a Socket connection to name:port. It will read the first few &#8220;logfile=&#8230;&#8221; lines from the server and create an internal list of all log-files exposed by the server.</p><p>A second configuration file called &#8220;colors.xml&#8221; associates tags (lines from a certain logfile) with specific colors. Here&#8217;s an example &#8220;colors.xml&#8221; file:</p><pre class="code-java">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span> ?&gt;
 &lt;colors&gt;
 	&lt;color name=<span class="code-quote">"app"</span> value=<span class="code-quote">"#880000"</span>/&gt;
 	&lt;color name=<span class="code-quote">"web"</span> value=<span class="code-quote">"#000088"</span>/&gt;
 	&lt;color name=<span class="code-quote">"err"</span> value=<span class="code-quote">"#008888"</span>/&gt;
 &lt;/colors&gt;</pre><p>As log-data arrives from the server, information is color-coded (using the colors-tag) and output in the Text-area that represents the combined log.<br
/> If multiple log-servers are involved for &#8220;staging&#8221;, then multiple host-entries can be given:</p><pre class="code-java">&lt;connection name=<span class="code-quote">"staging"</span>&gt;
 	&lt;host name=<span class="code-quote">"staging1.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"staging2.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"staging3.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 &lt;/connection&gt;</pre><p>And of course, one can have multiple connection entries in the XML file as well:</p><pre class="code-java">&lt;connection name=<span class="code-quote">"local"</span>&gt;
 	&lt;host name=<span class="code-quote">"localhost"</span> port=<span class="code-quote">"20000"</span>/&gt;
 &lt;/connection&gt;
 &lt;connection name=<span class="code-quote">"staging"</span>&gt;
 	&lt;host name=<span class="code-quote">"staging1.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"staging2.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"staging3.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 &lt;/connection&gt;
 &lt;connection name=<span class="code-quote">"deployment"</span>&gt;
 	&lt;host name=<span class="code-quote">"deploy1.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"deploy2.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"deploy3.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"deploy4.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;host name=<span class="code-quote">"deploy5.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 &lt;/connection&gt;</pre><p>The above XML file would allow people to connect to three different environment called &#8220;local&#8221;, &#8220;staging&#8221; and &#8220;deployment&#8221;.</p><p>Especially for development systems, those log-files are usually not on remote systems, but are located on the developers machine directly. To avoid having to install an xinetd/inetd environment, the AIR application also knows how to listen on local filesystem resources. Consider this case:</p><pre class="code-java">&lt;connection name=<span class="code-quote">"development"</span>&gt;
 	&lt;host name=<span class="code-quote">"authentication.server.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;file name=<span class="code-quote">"app"</span> location=<span class="code-quote">"c:tmpserver.log"</span>/&gt;
 	&lt;file name=<span class="code-quote">"web"</span> location=<span class="code-quote">"c:apachelogsaccess_log"</span>/&gt;
 &lt;/connection&gt;</pre><p>This XML configuration declares one remote server for authentication logging information and two local files (in this case a Windows system) which are color-coded with the &#8220;app&#8221; and &#8220;web&#8221; tags.<br
/> Again, information from all three log-sources would be interleaved into one log-display.</p><h5><a
title="AirLog-HistoryandFollow" name="AirLog-HistoryandFollow"></a>History and Follow</h5><p>In the AIR UI you will find a history-popup. This popup allows you to specify how many log-lines you want to keep in memory. The more lines, the higher the applications memory requirements. A value of 1000 is a good tradeoff between memory-consumption and time-span covered by the history items (that is unless one of your servers creates 200-lines stacktraces every few seconds).</p><p>The &#8220;follow&#8221; option allows you to always scroll to the bottom in the Text-area when new log-lines arrive (very much like &#8220;tail -f&#8221; in a Terminal window).</p><h5><a
title="AirLog-Enabling/Disabling" name="AirLog-Enabling/Disabling"></a>Enabling/Disabling &#8220;tags&#8221;</h5><p>As soon as log-data arrives in your AIR client, you will see a number of checkboxes on the right-hand side with all the tags announced via &#8220;logfile=xxxx:&#8221; or specified in name for file-entries. Sometimes you may want to concentrate only on a subset of the log-information that&#8217;s available to you. By deselecting a checkbox, you can remove the items associated with that tag from the log display. Information is still recorded, however it is suppressed as long as the checkbox is deselected.</p><p>Next to the checkbox for each tag, you&#8217;ll also find a color-picker that allows you to change colors for tags on the fly. The same applies to the background color of the Text-area. If the application detects a color change you&#8217;ll also get option to save out the new color values.</p><h5><a
title="AirLog-Filtering" name="AirLog-Filtering"></a>Filtering</h5><p>The &#8220;filter&#8221; textinput on the top allows you to narrow down information from all log files. Entering text in that textinput-field will only show log-lines from all log-files that contain the case-sensitive text entered there. Entering for example &#8220;Exception&#8221; in the textinput-field will only show all lines that contain the word &#8220;Exception&#8221;.<br
/> The AIR client also supports connection specific auto-filtering. Consider the following XML configuration fragment:</p><pre class="code-java">&lt;connection name=<span class="code-quote">"test"</span>&gt;
 	&lt;host name=<span class="code-quote">"a.host.com"</span> port=<span class="code-quote">"20000"</span>/&gt;
 	&lt;filters&gt;
 		&lt;filter name=<span class="code-quote">"file_not_found"</span> expression=<span class="code-quote">"File not found: (.*)"</span>/&gt;
 	&lt;/filters&gt;
 &lt;/connection&gt;</pre><p>If the AIR client encounters one or more connection specific filters, it will test the regular expression &#8220;expression&#8221; against all log-lines and will turn all items in capture-groups (those within parenthesis) into hyper-links. Clicking on a hyperlink in the log display will only show lines that contain that specific search term.</p><h3>Download</h3><p>The AIRlog application requires the latest AIR-runtime from Adobe Systems. Click on the links below to download the requires pieces and the AIRLog application as well.</p><p><center><iframe
src="/air/airlog.html" frameborder="0" height="200" width="400"></iframe></center></p> ]]></content:encoded> <wfw:commentRss>http://www.kahunaburger.com/2009/03/25/airlog/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>AIR Link Report visualizer</title><link>http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/</link> <comments>http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/#comments</comments> <pubDate>Sat, 08 Mar 2008 16:03:57 +0000</pubDate> <dc:creator>Tobias</dc:creator> <category><![CDATA[AIR]]></category> <category><![CDATA[Flex]]></category> <guid
isPermaLink="false">http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/</guid> <description><![CDATA[The Flex compiler has a rarely used feature called &#8220;link-report&#8221;. Using this option instructs the compiler to create a report of all symbols that went into the compiled application as well as a list of all external references. The Reducing SWF file sizes livedocs-page has more information about link reports. To enable it, you would [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://www.adobe.com/products/flex/">Flex</a> compiler has a rarely used feature called &#8220;link-report&#8221;. Using this option instructs the compiler to create a report of all symbols that went into the compiled application as well as a list of all external references. The <a
href="http://livedocs.adobe.com/flex/3/html/help.html?content=performance_06.html">Reducing SWF file sizes</a> livedocs-page has more information about link reports.</p><p>To enable it, you would either modify your Flex projects&#8217; compiler settings:</p><p><center><img
src='http://www.kahunaburger.com/wp-content/uploads/linkreportair-01.png' alt='link-report flex compiler settings' /></center></p><p>or you would use &#8220;-link-report output.xml&#8221; as an option on the mxmlc command line. In either case, an XML file with all definitions will be created after the compiler successfully built the SWF-file.</p><p>The contents of the link report file look like this:<br
/><center><img
src='http://www.kahunaburger.com/wp-content/uploads/linkreportair-02.png' alt='link report xml' /></center></p><p>Hmmm &#8211; not very easy to digest by just reading the file in a text-editor. <a
href="http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/">Theo Hultberg over at iconara.net created an XSL-script</a> that transforms link-reports into human-readable HTML. While this is interesting, it did not give me the &#8220;big picture&#8221; for all the pieces that go into my applications.</p><p>I created an <a
href="http://www.adobe.com/go/air/">AIR</a> application which can read, digest and visualize link-report files.</p><p>After installing the LinkReportAIR application, you can use the &#8220;Browse &#8230;&#8221; button to select a link-report XML file on your system or alternatively just drag and drop an XML-file on the AIR application itself.<br
/><center><img
src='http://www.kahunaburger.com/wp-content/uploads/linkreportair-03.png' alt='link report air 1' /></center></p><p>The DataGrid on the left lists all symbols included in the report (under &#8220;id&#8221;), the modification date for the symbol (if available), the package it is included in, the size of the symbol and the optimized size (if available). You can use the DataGrid headers to sort the symbols using any of the columns.<br
/> All symbols that do not have a package associated with them are automatically assigned to a package called &#8220;global&#8221;. Any symbol that ends in &#8220;_properties&#8221; is assigned to a package called &#8220;properties&#8221;.</p><p>If you click on any of the symbols in the DataGrid, the bottom portion will show you where this symbol comes from (this can be a SWC or any of your sources) and whether is has &#8220;prerequisites&#8221; or &#8220;dependencies&#8221; associated with it (the livedocs link above has more details about these):</p><p><center><img
src='http://www.kahunaburger.com/wp-content/uploads/linkreportair-04.png' alt='link report air 2' /></center></p><p>The neatest feature of LinkReportAIR is the little treemap (using <a
href="http://www.ilog.com/products/elixir/">ILOG Elixir</a>) that is automatically created from the data in the link report. It tries to visualize the space consumption per package. In the screenshot below, I&#8217;m hovering over the &#8220;mx.controls&#8221; package (and all packages included in it) and LinkReportAIR tells me that the (unoptimized) size of everything contained under mx.controls.* is roughly 500 KBytes and that this equals about 25% of my applications total size.</p><p><center><img
src='http://www.kahunaburger.com/wp-content/uploads/linkreportair-05.png' alt='link report air treemap' /></center></p><p>Double-clicking on a package in the tree-map will &#8220;drill down&#8221; and allows you to focus on certain portions of the package tree. While &#8220;drilled down&#8221;, the DataGrid on the left will also be filtered to only show symbols in the current drilled down subtree. To get back to the entire view, you would double-click again on the subtree-symbol that is currently in focus (sounds complicated, but you&#8217;ll get it once you use it).</p><p>And finally the &#8220;External Symbols&#8221; tab will show all symbols that are externally required (like the stuff that&#8217;s exported from the Flash Player itself). That list will grow if you decide to link the Flex Framework externally via Runtime Shared Libraries (RSLs):</p><p><center><img
src='http://www.kahunaburger.com/wp-content/uploads/linkreportair-06.png' alt='link report air external' /></center></p><p>You can download and install the AIR application using the badge below. If you need a sample link-report file to play with, then use the one that I generated from the application itself: <a
href="http://www.kahunaburger.com/air/LinkReportAIR/link-report.xml">link-report.xml</a> (use &#8220;Save Link As &#8230;&#8221; to save the report locally)</p><p><center><iframe
src="/air/LinkReportAIR/LinkReportAIR.html" frameborder="0" height="300" width="300"></iframe></center></p> ]]></content:encoded> <wfw:commentRss>http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> </channel> </rss>
