Guest User

Untitled

a guest
Feb 26th, 2016
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. define ddl
  2. set $log = ngx_cycle->log
  3.  
  4. while ($log != 0) && ($log->writer != ngx_log_memory_writer)
  5. set $log = $log->next
  6. end
  7.  
  8. if ($log->wdata != 0)
  9. set $buf = (ngx_log_memory_buf_t *) $log->wdata
  10. dump binary memory debug_log.txt $buf->start $buf->end
  11. end
  12. end
  13. document ddl
  14. Dump in memory debug log.
  15. end
  16.  
  17. define dcfg
  18. set $cd = ngx_cycle->config_dump
  19. set $nelts = $cd.nelts
  20. set $elts = (ngx_conf_dump_t*)($cd.elts)
  21. while ($nelts-- > 0)
  22. set $name = $elts[$nelts]->name.data
  23. printf "Dumping %s to nginx_conf.txt\n", $name
  24. append memory nginx_conf.txt \
  25. $elts[$nelts]->buffer.start $elts[$nelts]->buffer.end
  26. end
  27. end
  28. document dcfg
  29. Dump nginx configuration.
  30. end
RAW Paste Data