Jump to content

[Solved] I need to see my application's logs (and also: can't log to file?)


Recommended Posts

Posted

Hi, yesterday I deployed a new version of my .war but something didn't work. I mean, it did deploy successfully and I can use methods that access the database through a management page, but there's a scheduled job that isn't running.

 

Unfortunately, I've set my application to write in its own log file under "home/cridus10/logs", but the file doesn't get created at all. Does it lack permissions?

 

Can you please look at my app's logs to see if there's an error and give the stack trace to me in private?

 

Thank you very much.

Posted

To write to a log in your home folder, make sure first that you gave the folder the correct permissions. The folder needs "other" to have write permissions since Java apps run under another user. Also, you specified a path...make sure it has a leading / on it. It needs to be /home/cridus10/logs, not home/cridus10/logs

 

Krydos can get the Tomcat logs for you...

Posted

Thanks, I've changed the permissions to the "logs" folder to give read and write permissions to "world", but the log file still doesn't get created...

 

The path was correct.

 

I asked Krydos yesterday on Discord. He hasn't replied yet but it's understandable since it's Christmas.

Posted

To be completely honest, there are literally gigabytes of logs and they are all a jumble of like 40 different deployed .wars and most of the lines in the log files don't even state which .war they originated from, etc. etc. You're much better off writing your own log files to your own home directory or testing this on your home pc because there's not a lot I can do for you even if I wanted to. That said I found one severe error that MAY belong to your application. I don't even know for sure. I PM'd it to you even though there is a chance it may be private information from someone else's .war. In the future if you can be a little more specific or give me some string to search for maybe.

Posted (edited)

It wasn't a log of my app, no.

I'll try logging into a file directly in my home folder ("/home/cridus10")...

 

Edit: Ok! I changed the path to that folder and also I manually created the log file and gave it the right permissions instead of letting the application create it, and now it manages to write to it. Sorry for bothering you.

Edited by cridus
Posted

Create the log file manually, and then make sure the file is writable by other. 777 is a little bit of overkill, but it'll get the job done. If you want the application to be able to create the file itself you'll need to set the permissions on the directory the log is going to be written in to 777 or so. Obviously you can't change the permissions on /home/cridus10/, but you could create a directory like /home/cridus10/javalogs/ and give tomcat the permissions to write to that directory.

Posted (edited)

The odd thing is, I've tried setting the permissions to 666 to the "logs" folders and also creating the file manually with 666, but the application still won't write in it.

But if I create the file in "/home/cridus10" with those same permissions, it can be written to. Do you know why that could be?

 

P.S. I had edited my previous post.

Edited by cridus
Posted

The directory would need to be 777. Directories have to be executable. 755 is a standard directory, and public_html is special and gets 750. /home/cridus10/ is also special and actually has 711 permissions. All of the directory permissions I've listed are executable though.

Guest
This topic is now closed to further replies.
×
×
  • Create New...