Jump to content


Photo

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

Tommy Java

  • Please log in to reply
8 replies to this topic

#1 cridus

cridus

    Rank I Member

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Italy

Posted 24 December 2018 - 11:10 AM

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.

#2 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 10,408 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 24 December 2018 - 04:53 PM

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...


Please do not PM me for support. Posting on our forums lets all of us learn.
Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...


#3 cridus

cridus

    Rank I Member

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Italy

Posted 24 December 2018 - 06:07 PM

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.

#4 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 18,089 posts
  • Gender:Male

Posted 25 December 2018 - 08:54 PM

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.

#5 cridus

cridus

    Rank I Member

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Italy

Posted 25 December 2018 - 09:02 PM

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, 25 December 2018 - 09:08 PM.


#6 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 18,089 posts
  • Gender:Male

Posted 25 December 2018 - 09:08 PM

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.

#7 cridus

cridus

    Rank I Member

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Italy

Posted 25 December 2018 - 09:23 PM

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, 25 December 2018 - 09:23 PM.


#8 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 18,089 posts
  • Gender:Male

Posted 25 December 2018 - 09:41 PM

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.

#9 cridus

cridus

    Rank I Member

  • Members
  • Pip
  • 41 posts
  • Gender:Male
  • Location:Italy

Posted 25 December 2018 - 09:56 PM

Ok thanks, I didn't know that directories have to be executable.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users