title: How to generate a log file in C Language?
body: <p>I have created a C program to log to a file with a function, but the log file is not being created.</p>
  
  <p>My log file program is like...</p>
  
  <pre><code>int foo_handler( request_rec* inpRequest ) {
      int nReturnVal = DECLINED;
  
      if ( inpRequest-&gt;handler != NULL &amp;&amp; strcmp( inpRequest-&gt;handler, "foo" ) == 0 )
      {
          ap_rputs( "Hello World from FOO", inpRequest );
          nReturnVal = OK;
      }
  
      return nReturnVal; }
  
  void foo_hooks( apr_pool_t* inpPool ) {
      ap_hook_handler( foo_handler, NULL, NULL, APR_HOOK_MIDDLE ); }
  
  
  module AP_MODULE_DECLARE_DATA foo_module = {
      STANDARD20_MODULE_STUFF,
      NULL,
      NULL,
      NULL,
      NULL,
      NULL,
      foo_hooks };
  </code></pre>