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 trialAlex Rodriguez
Front End Web Development Techdegree Student 20,810 PointsCant 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
Courses Plus Student 18,036 PointsHi 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