Export Tomcat Catalina Logs to external serverTomcat Servlet not showing Log outDifference between the Apache HTTP Server and Apache Tomcat?How to configure Tomcat JULI logging to roll log files?How to have git log show filenames like svn log -vJSF2 logs with tomcatException when running Tomcat server org.apache.catalina.deploy.WebXml addServletTomcat System.out redirectionHow to install ssl in Tomcat 7 - Amazon ec2 ubuntu instanceTomcat logging stops (pauses) soon after initializationHide strange unwanted Xcode logsHow can I disable juli logging in tomcat 8?
Can I sign legal documents with a smiley face?
Should I install hardwood flooring or cabinets first?
Why did the HMS Bounty go back to a time when whales are already rare?
My friend sent me a screenshot of a transaction hash, but when I search for it I find divergent data. What happened?
Do the concepts of IP address and network interface not belong to the same layer?
Did US corporations pay demonstrators in the German demonstrations against article 13?
Is a model fitted to data or is data fitted to a model?
Freedom of speech and where it applies
Why is Arduino resetting while driving motors?
Will adding a BY-SA image to a blog post make the entire post BY-SA?
What (else) happened July 1st 1858 in London?
Global amount of publications over time
Has Darkwing Duck ever met Scrooge McDuck?
Is XSS in canonical link possible?
Open a doc from terminal, but not by its name
How much character growth crosses the line into breaking the character
Greco-Roman egalitarianism
When quoting, must I also copy hyphens used to divide words that continue on the next line?
Why does Async/Await work properly when the loop is inside the async function and not the other way around?
Flux received by a negative charge
Should I stop contributing to retirement accounts?
Hot bath for aluminium engine block and heads
How will losing mobility of one hand affect my career as a programmer?
Can we have a perfect cadence in a minor key?
Export Tomcat Catalina Logs to external server
Tomcat Servlet not showing Log outDifference between the Apache HTTP Server and Apache Tomcat?How to configure Tomcat JULI logging to roll log files?How to have git log show filenames like svn log -vJSF2 logs with tomcatException when running Tomcat server org.apache.catalina.deploy.WebXml addServletTomcat System.out redirectionHow to install ssl in Tomcat 7 - Amazon ec2 ubuntu instanceTomcat logging stops (pauses) soon after initializationHide strange unwanted Xcode logsHow can I disable juli logging in tomcat 8?
I am using Tomcat 7.x as my web server and I am using java.util.logging and JULI for logging. This Tomcat server is hosted an Amazon EC2 instance which runs Ubuntu.
The Problem is whenever I wish to see the logs (in catalina.log file) I have go through a very time consuming process of copying, chowing and then downloading the files to my local machine before I can see them. (I can use utilities like nano or vi but they do not help much)
My Question Can I automatically exports the logs to some external server and view them straight away. Some thing similar to Bugsense for ACRA reports in Android.
java
add a comment |
I am using Tomcat 7.x as my web server and I am using java.util.logging and JULI for logging. This Tomcat server is hosted an Amazon EC2 instance which runs Ubuntu.
The Problem is whenever I wish to see the logs (in catalina.log file) I have go through a very time consuming process of copying, chowing and then downloading the files to my local machine before I can see them. (I can use utilities like nano or vi but they do not help much)
My Question Can I automatically exports the logs to some external server and view them straight away. Some thing similar to Bugsense for ACRA reports in Android.
java
it is much more convenient to use less command to view logs files. Even more convenient than notepad or something similar. You just need to used to. Everything you need: scroll page up/down, scroll cursor and search
– Anton
Nov 22 '12 at 20:13
add a comment |
I am using Tomcat 7.x as my web server and I am using java.util.logging and JULI for logging. This Tomcat server is hosted an Amazon EC2 instance which runs Ubuntu.
The Problem is whenever I wish to see the logs (in catalina.log file) I have go through a very time consuming process of copying, chowing and then downloading the files to my local machine before I can see them. (I can use utilities like nano or vi but they do not help much)
My Question Can I automatically exports the logs to some external server and view them straight away. Some thing similar to Bugsense for ACRA reports in Android.
java
I am using Tomcat 7.x as my web server and I am using java.util.logging and JULI for logging. This Tomcat server is hosted an Amazon EC2 instance which runs Ubuntu.
The Problem is whenever I wish to see the logs (in catalina.log file) I have go through a very time consuming process of copying, chowing and then downloading the files to my local machine before I can see them. (I can use utilities like nano or vi but they do not help much)
My Question Can I automatically exports the logs to some external server and view them straight away. Some thing similar to Bugsense for ACRA reports in Android.
java
java
asked Nov 22 '12 at 19:41
Gaurav AgarwalGaurav Agarwal
8,4012690148
8,4012690148
it is much more convenient to use less command to view logs files. Even more convenient than notepad or something similar. You just need to used to. Everything you need: scroll page up/down, scroll cursor and search
– Anton
Nov 22 '12 at 20:13
add a comment |
it is much more convenient to use less command to view logs files. Even more convenient than notepad or something similar. You just need to used to. Everything you need: scroll page up/down, scroll cursor and search
– Anton
Nov 22 '12 at 20:13
it is much more convenient to use less command to view logs files. Even more convenient than notepad or something similar. You just need to used to. Everything you need: scroll page up/down, scroll cursor and search
– Anton
Nov 22 '12 at 20:13
it is much more convenient to use less command to view logs files. Even more convenient than notepad or something similar. You just need to used to. Everything you need: scroll page up/down, scroll cursor and search
– Anton
Nov 22 '12 at 20:13
add a comment |
3 Answers
3
active
oldest
votes
You could create a servlet to run in Tomcat to read the logs and display them in your web browser. Or if the file is large, zip it up and allow you to download it.
Use the environment variable catalina.base to determine the base directory and then gather up logs/catalina.log.
[update]
The best approach would depend on your background. If you are comfortable doing a basic, no-frills servlet, start with the simplest design that could possibly work such as:
class LogServlet extends HttpServlet
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
File logFile = new File(System.getProperty("catalina.base"), "logs/catalina.log");
String contents = FileUtils.readFileToString(logFile);
PrintWriter out = new PrintWriter(resp.getOutputStream());
out.println(contents);
I am using commons-io to simplify reading the log file, but otherwise it's just the Java servlet framework.
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
|
show 1 more comment
rsync then periodically use a cron job on the server you want or use some tool like collectd.
add a comment |
You could use logstash or fluentd to stream the logs and load into your prefered target, say Elastic Search. You could visualize or search through the logs from elasticsearch using visualization tools like Kibana or Graylog
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13519115%2fexport-tomcat-catalina-logs-to-external-server%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could create a servlet to run in Tomcat to read the logs and display them in your web browser. Or if the file is large, zip it up and allow you to download it.
Use the environment variable catalina.base to determine the base directory and then gather up logs/catalina.log.
[update]
The best approach would depend on your background. If you are comfortable doing a basic, no-frills servlet, start with the simplest design that could possibly work such as:
class LogServlet extends HttpServlet
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
File logFile = new File(System.getProperty("catalina.base"), "logs/catalina.log");
String contents = FileUtils.readFileToString(logFile);
PrintWriter out = new PrintWriter(resp.getOutputStream());
out.println(contents);
I am using commons-io to simplify reading the log file, but otherwise it's just the Java servlet framework.
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
|
show 1 more comment
You could create a servlet to run in Tomcat to read the logs and display them in your web browser. Or if the file is large, zip it up and allow you to download it.
Use the environment variable catalina.base to determine the base directory and then gather up logs/catalina.log.
[update]
The best approach would depend on your background. If you are comfortable doing a basic, no-frills servlet, start with the simplest design that could possibly work such as:
class LogServlet extends HttpServlet
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
File logFile = new File(System.getProperty("catalina.base"), "logs/catalina.log");
String contents = FileUtils.readFileToString(logFile);
PrintWriter out = new PrintWriter(resp.getOutputStream());
out.println(contents);
I am using commons-io to simplify reading the log file, but otherwise it's just the Java servlet framework.
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
|
show 1 more comment
You could create a servlet to run in Tomcat to read the logs and display them in your web browser. Or if the file is large, zip it up and allow you to download it.
Use the environment variable catalina.base to determine the base directory and then gather up logs/catalina.log.
[update]
The best approach would depend on your background. If you are comfortable doing a basic, no-frills servlet, start with the simplest design that could possibly work such as:
class LogServlet extends HttpServlet
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
File logFile = new File(System.getProperty("catalina.base"), "logs/catalina.log");
String contents = FileUtils.readFileToString(logFile);
PrintWriter out = new PrintWriter(resp.getOutputStream());
out.println(contents);
I am using commons-io to simplify reading the log file, but otherwise it's just the Java servlet framework.
You could create a servlet to run in Tomcat to read the logs and display them in your web browser. Or if the file is large, zip it up and allow you to download it.
Use the environment variable catalina.base to determine the base directory and then gather up logs/catalina.log.
[update]
The best approach would depend on your background. If you are comfortable doing a basic, no-frills servlet, start with the simplest design that could possibly work such as:
class LogServlet extends HttpServlet
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
File logFile = new File(System.getProperty("catalina.base"), "logs/catalina.log");
String contents = FileUtils.readFileToString(logFile);
PrintWriter out = new PrintWriter(resp.getOutputStream());
out.println(contents);
I am using commons-io to simplify reading the log file, but otherwise it's just the Java servlet framework.
edited Nov 22 '12 at 21:03
answered Nov 22 '12 at 20:43
Guido SimoneGuido Simone
6,87721217
6,87721217
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
|
show 1 more comment
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
+1, Idea seems workable to me, any libraries, blog or suggestion how to go about doing it.
– Gaurav Agarwal
Nov 22 '12 at 20:45
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
See update. We used the servlet approach above to do something similar.
– Guido Simone
Nov 22 '12 at 21:05
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
I will implement it. Any suggested libraries.
– Gaurav Agarwal
Nov 22 '12 at 21:22
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Just Apache commons-io.
– Guido Simone
Nov 22 '12 at 21:24
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
Ok, I will keep this question open for one more days looking for other contributors.
– Gaurav Agarwal
Nov 22 '12 at 21:33
|
show 1 more comment
rsync then periodically use a cron job on the server you want or use some tool like collectd.
add a comment |
rsync then periodically use a cron job on the server you want or use some tool like collectd.
add a comment |
rsync then periodically use a cron job on the server you want or use some tool like collectd.
rsync then periodically use a cron job on the server you want or use some tool like collectd.
edited Nov 22 '12 at 20:10
Chris Seymour
62.9k20125162
62.9k20125162
answered Nov 22 '12 at 19:51
xeyexeye
1,042813
1,042813
add a comment |
add a comment |
You could use logstash or fluentd to stream the logs and load into your prefered target, say Elastic Search. You could visualize or search through the logs from elasticsearch using visualization tools like Kibana or Graylog
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
add a comment |
You could use logstash or fluentd to stream the logs and load into your prefered target, say Elastic Search. You could visualize or search through the logs from elasticsearch using visualization tools like Kibana or Graylog
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
add a comment |
You could use logstash or fluentd to stream the logs and load into your prefered target, say Elastic Search. You could visualize or search through the logs from elasticsearch using visualization tools like Kibana or Graylog
You could use logstash or fluentd to stream the logs and load into your prefered target, say Elastic Search. You could visualize or search through the logs from elasticsearch using visualization tools like Kibana or Graylog
answered Mar 8 at 6:21
Ranjith MRKRanjith MRK
13
13
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
add a comment |
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker.
– Tiw
Mar 8 at 6:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13519115%2fexport-tomcat-catalina-logs-to-external-server%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
it is much more convenient to use less command to view logs files. Even more convenient than notepad or something similar. You just need to used to. Everything you need: scroll page up/down, scroll cursor and search
– Anton
Nov 22 '12 at 20:13