Hi. I have created my Streamlit app on the community cloud and it is not properly printing the logs. I know that I can view the log by clicking on the ‘Manage App’ on the bottom right and I can view/download the logs. However the logs don’t appear to be properly printing out the information. Sometimes it prints but most of the time it does not. If I run the program hosted locally I can see that everything prints correctly.
Basically I have some print statements in the code that I want to be able to see when I view the log. This both has some information about what features of the application are being used as well as some relevant data that would help debugging.
To my understanding, when a different user used the program, their work should also be included in the logs, however it does not appear as if this is the case. (however even when I am doing this it is not show in in the log)
Also as a side note, is there a way to delete the log if it gets very long and I do not want to deal with the long string when I download it?
Thanks for sharing this question! Is the main issue that the print statements you mentioned aren’t appearing in the log? If so, can you share a code snippet that includes an example of those print statements?
Yeah the main issue is that the print statements do not appear in the log most of the time.
Here is a snippet of my code.
uploaded_file = st.file_uploader("Please upload a file.")
if uploaded_file is not None:
print(f'Routing Program run time: {datetime.datetime.now()}')
Here I am asking the user to upload a file, and then if the file is uploaded I want it to print out in the log the when the program was ran. If I run it locally it works, and it occasionally works when running on the community cloud but it is very inconsistent. I want to be able to see when the program is being utilized and which of the functions are being used (this is just one function but for each of the different functions of my program I have a different print statement)
I have not done that and am not vary familiar with it. I have done a little digging and I do not see a config.toml file but I do see in the code there is venv → Lib\site-packages → absl → logging which I assume it is related to that. I am relatively new to coding so I am still getting affiliated with the ins and outs of it.
I will continue to do more research to determine how to set my logging level via the config.toml file and figure out what configuration would make this work. I greatly appreciate your help and when I’m able to do the dive into figuring this out I will be sure to come back here to let you know if there were any other road blocks/if it worked
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.