<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>lighty's life: Tag debuging</title>
    <link>http://blog.lighttpd.net/articles/tag/debuging</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>log-condition-handling, The hidden feature for debuging</title>
      <description>&lt;p&gt;Many features was introduced into lighttpd 1.4.x series to improve config file handling. But there's something left undocumented, yet nice feature, for debuging.&lt;/p&gt;
&lt;p&gt;It was originally implemented to debug the new condition caching system internally for developers only.&lt;/p&gt;

&lt;p&gt;But i found it nice for user
to debug how to condition is matching, seeing the 2 values on both
side of the operator, and if they matched. A new patch was commited to make it a bit cleaner for your use.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;just add or uncomment:
debug.log-condition-handling = "enable"
in your configuration.&lt;/li&gt;
&lt;li&gt;restart your lighttpd, or start it with sbin/lighttpd -Df lighttpd.conf&lt;/li&gt;
&lt;li&gt;request the url, and check the error.log, or stderr in case u haven't specified error.log&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;./sbin/ligittpd -pf test.conf&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;config {
  var.PID                      = 25629
  var.CWD                      = "/usr/src/lighttpd/branches/lighttpd-merge-1.4.x"
  server.modules               = ("mod_indexfile", "mod_staticfile")
  server.port                  = 8080
  server.document-root         = "/tmp"
  debug.log-condition-handling = "enable"


  $HTTP["useragent"] =~ "MSIE" {
    # block 1

  } # end of $HTTP["useragent"] =~ "MSIE"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;./sbin/lighttpd -Df test.conf&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;2006-04-02 13:40:05: (src/log.c.75) server started 
2006-04-02 13:40:07: (src/response.c.150) run condition 
2006-04-02 13:40:07: (src/configfile-glue.c.404) === start of 1 condition block === 
2006-04-02 13:40:07: (src/configfile-glue.c.356)
HTTP["useragent"] ( Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) ) compare to MSIE 
2006-04-02 13:40:07: (src/configfile-glue.c.419) 1 result: true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See also: &lt;a href="http://blog.lighttpd.net/articles/2005/05/07/advanced-configuration-in-up-upcoming-1-4-x"&gt;advanced configuration in 1.4.x&lt;/a&gt;, 
&lt;a href="http://blog.lighttpd.net/articles/2005/08/24/lighttpd-unleashed-part-one"&gt;lighttpd unleashed part one&lt;/a&gt;, 
&lt;a href="http://blog.lighttpd.net/articles/2005/08/24/lighttpd-unleashed-part-two"&gt;lighttpd unleashed part two&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 02 Apr 2006 05:46:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:cd2202e1-64cf-44b0-af65-b52371220518</guid>
      <author>moo</author>
      <link>http://blog.lighttpd.net/articles/2006/04/02/log-condition-handling-the-hidden-feature-for-debuging</link>
      <category>lighttpd</category>
      <category>debuging</category>
      <category>configfile</category>
      <category>configuration</category>
      <category>conditionals</category>
      <trackback:ping>http://blog.lighttpd.net/articles/trackback/159</trackback:ping>
    </item>
  </channel>
</rss>
