mod_log_config.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * @file mod_log_config.h
  18. * @brief Logging Configuration Extension Module for Apache
  19. *
  20. * @defgroup MOD_LOG_CONFIG mod_log_config
  21. * @ingroup APACHE_MODS
  22. * @{
  23. */
  24. #include "apr_optional.h"
  25. #include "httpd.h"
  26. #include "scoreboard.h"
  27. #ifndef _MOD_LOG_CONFIG_H
  28. #define _MOD_LOG_CONFIG_H 1
  29. /**
  30. * callback function prototype for a external log handler
  31. */
  32. typedef const char *ap_log_handler_fn_t(request_rec *r, char *a);
  33. /**
  34. * callback function prototype for external writer initialization.
  35. */
  36. typedef void *ap_log_writer_init(apr_pool_t *p, server_rec *s,
  37. const char *name);
  38. /**
  39. * callback which gets called where there is a log line to write.
  40. */
  41. typedef apr_status_t ap_log_writer(
  42. request_rec *r,
  43. void *handle,
  44. const char **portions,
  45. int *lengths,
  46. int nelts,
  47. apr_size_t len);
  48. typedef struct ap_log_handler {
  49. ap_log_handler_fn_t *func;
  50. int want_orig_default;
  51. } ap_log_handler;
  52. APR_DECLARE_OPTIONAL_FN(void, ap_register_log_handler,
  53. (apr_pool_t *p, char *tag, ap_log_handler_fn_t *func,
  54. int def));
  55. /**
  56. * you will need to set your init handler *BEFORE* the open_logs
  57. * in mod_log_config gets executed
  58. */
  59. APR_DECLARE_OPTIONAL_FN(ap_log_writer_init*, ap_log_set_writer_init,(ap_log_writer_init *func));
  60. /**
  61. * you should probably set the writer at the same time (ie..before open_logs)
  62. */
  63. APR_DECLARE_OPTIONAL_FN(ap_log_writer*, ap_log_set_writer, (ap_log_writer* func));
  64. #endif /* MOD_LOG_CONFIG */
  65. /** @} */