2013-12-17 43 views
0

这是我的代码,写在Visual Studio 2008的代码得到编译和运行成功我通过调试代码检查,我没有得到我的error.log消息文件中的日志消息,帮助我,如果我犯了一些错误无法在error.log文件APACHE模块中获取日志消息?

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include "apr_optional.h" 
#include <httpd.h> 
#include <http_protocol.h> 
#include <http_config.h> 
#include <http_log.h> 
#include "apr_general.h" 
#include "apr_getopt.h" 
#include "apr_xml.h" 
#include "apr_file_io.h" 
static int hello_handler(request_rec *r) 
{ 



    ap_log_error(APLOG_MARK,APLOG_INFO,0,NULL,"Entered Function = hello_handler, time = %d",r->finfo.mtime); 



     /* We set the content type before doing anything else */ 
//  ap_set_content_type(r, "text/html"); 

     /* If the request is for a header only, and not a request for 
     * the whole content, then return OK now. We don't have to do 
     * anything else. */ 
     if (r->header_only) 
     { 
       return OK; 
     } 

    ap_log_error(APLOG_MARK,APLOG_INFO,0,NULL, "Exit Function = hello_handler,time = %d",r->finfo.mtime); 
} 


static void InitLog_Hooks(apr_pool_t *pool) 
{ 
    ap_hook_handler(hello_handler, NULL, NULL, APR_HOOK_LAST); 
} 

module AP_MODULE_DECLARE_DATA SampleLog_modules = { 
    STANDARD20_MODULE_STUFF, 
    NULL, 
    NULL, 
    NULL, 
    NULL, 
    NULL, 
    InitLog_Hooks 
} ; 
+0

我试图改变loglevel到“httpd.conf”配置文件中的信息,这没有帮助 –

回答

0

这是非常第四个参数easy..just改变 R->服务器 你会在error.log文件geterror消息.. 此外,我们可以通过使用重定向日志消息到自己的文件api

ap_replace_stderr_log (pool,"Filepath"); 

干杯!

相关问题