Add query parameters to readFile to permit truncation of output
Opened 3 years ago
Last modified 3 years ago
#2238newenhancement
Add query parameters to readFile to permit truncation of output
Reported by:ReportageOwned by: Priority: minor Milestone: undecided Component: api/utils Version: 0.9.34 Keywords: FileUtil, readFile, readTextFile, log viewer Cc:
Parent Tickets:
Sensitive: no
Description
Given that the default size for log files is 10MB, it would be useful to be able to send a query parameter with the url to truncate, either from the top of the log with ?head=filesize, or from the bottom with ?tail=filesize, to permit less onerous viewing of logs in the browser. Looks like readFile in FileUtil?.java is where the change needs to happen.
Additionally, it would be useful to be able to use readTextFile with query parameters to parse log files for better in-browser formatting. eg. /parse?file=/router.log&tail=256
, where the head and tail queries would relate to number of lines rather than filesize.