Index: libs/mod_neko/mod_neko.c
===================================================================
RCS file: /cvsroot/neko/libs/mod_neko/mod_neko.c,v
retrieving revision 1.31
diff -u -r1.31 mod_neko.c
--- libs/mod_neko/mod_neko.c	20 Apr 2007 14:05:48 -0000	1.31
+++ libs/mod_neko/mod_neko.c	4 Dec 2007 12:57:52 -0000
@@ -26,9 +26,11 @@
 #	define ap_soft_timeout(msg,r)
 #	define ap_kill_timeout(r)
 #	define ap_table_get		apr_table_get
+#	define DEFAULT_STATUS	APR_SUCCESS, 
 typedef apr_time_t aptime;
 #else
 #	define FTIME(r)		r->finfo.st_mtime
+#	define DEFAULT_STATUS	
 typedef time_t aptime;
 #endif
 
@@ -104,6 +106,10 @@
 	return r->unparsed_uri;
 }
 
+static void log_rerror(int level, request_rec *r, const char* message) {
+	ap_log_rerror(__FILE__, __LINE__, level, DEFAULT_STATUS r, "[mod_neko error] %s", message);
+}
+
 static void cache_module( request_rec *r, value main ) {
 	cache *c = (cache*)context_get(cache_root);
 	value fname = alloc_string(r->filename);
@@ -140,6 +146,7 @@
 	if( ap_setup_client_block(r,REQUEST_CHUNKED_ERROR) != 0 ) {
 		send_headers(&ctx);
 		ap_rprintf(r,"<b>Error</b> : ap_setup_client_block failed");
+		log_rerror(APLOG_CRIT, r, "ap_setup_client_block failed");
 		return OK;
 	}
 
@@ -158,6 +165,7 @@
 		if( tlen >= MOD_NEKO_POST_SIZE ) {
 			send_headers(&ctx);
 			ap_rprintf(r,"<b>Error</b> : Maximum POST data exceeded. Try using multipart encoding");
+			log_rerror(APLOG_CRIT, r, "Maximum POST data exceeded. Try using multipart encoding");
 			return OK;
 		}
 		ctx.post_data = buffer_to_string(b);
@@ -168,6 +176,7 @@
 	if( use_jit && !neko_vm_jit(vm,1) ) {
 		send_headers(&ctx);
 		ap_rprintf(r,"<b>Error</b> : JIT required by env. var but not enabled in NekoVM");
+		log_rerror(APLOG_CRIT, r, "JIT required by env. var but not enabled in NekoVM");
 		return OK;
 	}
 
