ARCANEDEV / LogViewer

:page_with_curl: Provides a log viewer for Laravel
MIT License
2.37k stars 335 forks source link

How to view other named log files (laravel-cli-) #65

Closed palpalani closed 8 years ago

palpalani commented 8 years ago

Recently, we faced permission issue for creating logs. So we created separate log file for cli. Our logs file names like laravel-cli-2016-05-19.log, laravel-fpm-fcgi-2016-05-14. Permission issue is resolve, but we are not able view these log files using LogViewer.

How to view those log files?

arcanedev-maroc commented 8 years ago

This package doesn't support this feature. The only thing you can do is to override the LogViewer classes and especially the Filesystem Class.

arcanedev-maroc commented 8 years ago

Good news @palpalani, i solved your case.

You can use now the new methods to load your custom log files names.

Or by using the new config file pattern attributes.

Available from arcanedev/logivewer >= 3.10.0.

palpalani commented 8 years ago

Wow! Thank you very much.

Is this supporting multiple patterns?

arcanedev-maroc commented 8 years ago

You're going to do it manually (you can use the LogViewer as an API).

  1. Disable the default LogViewer routes.
  2. Create your new log-viewer routes by using prefixes or slugs (cli, fpm-fcgi).
  3. Create a new LogViewer Controller (You can copy some codes from the base LogViewer Controller), and use the new methods to set pattern based on prefixes/slugs.
  4. Edit views and other stuff if necessary.
  5. Profit :moneybag:
palpalani commented 8 years ago

yes, duplicated your LogViewerController and then assigned custom pattern value like $this->logViewer->setPattern('laravel-web-', $date, $extension);.

Wow! it works.

hhhcj commented 4 years ago

If there is a simple way to realize this feature, that must be cool.