简体   繁体   中英

wkhtmltopdf writes in apache error log for every pdf created

Every time a PDF is created in WKHTMLTOPDF (using php) i am getting the following in the apache error log:

Loading pages (1/6)
[>                                                           ] 0%
[======>                                                     ] 10%
[==========>                                                 ] 17%
[===================>                                        ] 32%
[==============================>                             ] 50%
[=====================================>                      ] 63%
[============================================>               ] 74%
[============================================================] 100%
Counting pages (2/6)                                               
[============================================================] Object 1 of 1
Resolving links (4/6)                                                       
[============================================================] Object 1 of 1
Loading headers and footers (5/6)                                           
Printing pages (6/6)
[>                                                           ] Preparing
[============================================================] Page 1 of 1
Done                                                                      

However the pdf is created without any errors, is there a way of stopping this as the error logs are getting very large and also masking genuine errors?

Thanks

To silence wkhtmltopdf specifically:

  1. Use the --quiet flag:

      exec("wkhtmltoimage -q …"); 
  2. And redirect stderr per 2>/dev/null or similar shell features:

      exec("wkhtmltopdf -q … 2>&1"); 

The latter works with most command-line tools, btw.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM