Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Building Websites with PHP Dependency Management Namespacing

Alex Rodriguez
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Rodriguez
Front End Web Development Techdegree Student 20,810 Points

Cant get app.txt to generate?

I cant get the app.txt file to show up on my file tree. After I ran the code below not even my echo statement shows up. However when I comment out //$log->addWarning('Foo'); my echo statement shows up but still no app.txt file.

I have read previous questions and have tried restarting my browser and workspace, clearing cache, making a new index.php file but still having no luck. I'm not sure what I am doing wrong here.

Here is my code:

<?php

require 'vendor/autoload.php';

$log = new Monolog\Logger('name'); $log->pushHandler(new Monolog\Handler\StreamHandler('app.txt', Monolog\Logger::WARNING));

$log->addWarning('Foo');

echo 'Hi Mate!';

1 Answer

kabir k
PLUS
kabir k
Courses Plus Student 18,036 Points

Hi Alex,

You first need to preview your index.php page by clicking on the eye icon on the top right of workspaces, then go over to the left pane for the file tree right-click on there and then click 'Refresh'. You app.txt file should now show up in your file tree.

Hope this helps.

kabir