Configuring a CLI application for logging

55 views
Skip to first unread message

Karthik Narendran

unread,
Oct 25, 2015, 1:18:15 AM10/25/15
to Joomla! Framework Development
Hello,

I was just trying out Joomla! Framework, and so far, got a simple CLI application, displaying "Hello World!" to run fine. Thanks to the wonderful documentation at https://github.com/joomla-framework/application/blob/master/README.md

While attempting to include logging, I stumbled across a problem. The docs mentioned usage of $this->get('logger.path') as the path of the log file generated. The problem is that this path is never being set. The comments in the sample program mentions a configuration file. Now, the issue is configuring the application.

Another sample program at beginning of the documentation mentions overriding of the constructor, where arguments passed to the constructor includes an Input and a Registry object. Maybe these would help. Not yet sure how to implement them.

Any help would be greatly appreciated. Thanks.

Karthik Narendran

unread,
Oct 25, 2015, 2:23:39 AM10/25/15
to Joomla! Framework Development
Fixed it myself. Checked out docs on Registry (class of $config used in AbstractCliApplication constructor) and AbstractApplication classes.

Referring to those docs, was able to setup  a configuration file and load it using Registry class.

I am loving this :)
Reply all
Reply to author
Forward
0 new messages