New files don't show in editor (.log file extension)

Hello there!

I’ve recently set up an express webserver from the node app template. I’ve set up this webserver correctly to properly use authentication and am logging logins into .log files in the /logs directory.

All of this works correctly, as the files do correctly show up in the project console. I can also cat the created .log files, which show a properly formatted file.

The issue is that I currently am unable to view these files from the editor view. I assume that this is because the .log file extension is not automatically visible in the editor tree (Source: https://glitch.com/help/hidden-files/ ) and was wondering if I could somehow enable this.
Another solution would be for me to change the used extension to something that does automatically show up. I have done a quick test with .txt files, which proves a valid solution to my issue. I would however like to maintain the .log extension, which is why I wrote this in the first place.

Many thanks in advance!
I hope to hear from you

Unfortunately, this is not possible at the time.
I have changed the topic category to feature request.

@chroventer Thanks! I would indeed love this as a feature. I’ll stick to the .txt extension for now.

1 Like

you could always use cat and ls

@J-Tech-Foundation could you expand on this more?

1 Like
ls -a ~/<DIRECTORY> 

shows the files in the directory requested

cat ~/<DIRECTORY>/example.log

prints the file to console


i have spent way to much with the console lately, doing to much shell script… so i know exactly what to do EVERY time

so…
do this to see the log files present:

ls -a ~/logs/

that should print absolutely every file there
do THIS to read the files

cat ~/logs/<filename>.log

if you want to actually SEE the files…
do this:

cp ~/logs/*.log ~/fixed-logs/*.txt; refresh

that makes all the files in the logs directory get copied and pasted into the fixed-logs directory as a txt file, and then refreshes the editor so the files show up

if the command above does not work, and you do not mind filling up your root directory with files, you can try

cp *.log *.txt; refresh

or

cp *.log ~/fixed-logs/*.txt; refresh
1 Like

@J-Tech-Foundation As I mentioned in my initial post, the way I am reading my logs currently is via console using cat.

While this works perfectly fine, it still requires the console to load (using full-age console). In addition this console disconnects very often, requiring me to retype all the commands etc.
I must add however that if you spend a lot of time in console, I can understand that you see no issue here.


Another issue has popped up. I have changed my files to use a .txt extension, yet it still does not show. I believe this is because I group them in a directory, however I should not be doing this on the root since I create a new logfile per day.
If I can solve this in any way, I would love to here.

Otherwise, I would love to see this system changed to allow more user-specific freedom. Perhaps some sort of glitch-settings.json file that can change how the editor behaves?

1 Like

i just edited my post above, it shows you how to show those files

1 Like

The issue is, .txt files created via node-fs, console, … inside a directory do not show up in the editor, even after refreshing. When created in the project root, they do show up after a quick refresh.
Your solution would of course work if it wasn’t for the issue above.

This is however just a feature request right now, so I would suggest leaving it at that. I can manage with the pop-out console for now.

I really appreciate your willingness to help, yet another very nice thing about glitch and its community.

:stuck_out_tongue: oh, just to let you know, the glitch staff Do know about the console crashes, and they have been attempting to work on it, i am pretty sure it will be fixed soon

That is undoubtedly the case! Thanks for the enthusiasm!

1 Like

I don’t think this is a console crash issue, more a deliberate choice they’ve made to omit certain types of files from the editor

1 Like