-
1. Re: Log message to screen - possible in Weblogic, is it poss
jaikiran Mar 12, 2009 7:59 AM (in response to valatharv)"valatharv" wrote:
We have a java application what we need is :
Log messages from the application should print to screen/browser, so that administrator should see all lines printed to console by the program
By default log messages (at INFO level) logged through log4j go to the console. You will have to provide us more details as to where exactly you want to see those logs (in the console or browser)? And how are those messages logged? And which version of JBoss and Java? -
2. Re: Log message to screen - possible in Weblogic, is it poss
peterj Mar 12, 2009 10:46 AM (in response to valatharv)The log4j config file is located at server/xxx/conf/jboss-log4j.xml.
-
3. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 12, 2009 11:24 AM (in response to valatharv)Thanks for the reply.
We are generating application logs correctly using log jboss-log4j.xml
Log file is generated under
"C:\jboss-4.2.3\server\default\log\.log"
Sample jboss-log4j content from dev machine.<appender name="aTPPiclMetaDataSeam_FILE" class="org.jboss.logging.appender.RollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="Threshold" value="DEBUG"/> <param name="File" value="${jboss.server.log.dir}/<appSepcific>.log"/> <param name="Append" value="true"/> <param name="MaxFileSize" value="10240KB"/> <param name="MaxBackupIndex" value="2"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> </layout> </appender>
What we need is Admin should be able to see .log on BROWSER using some url.
I have seen this done by Weblogic serv admins., they provided us the url and we were able to see any log generation on Browser.
May be it is very simple but I need to investigate more. -
4. Re: Log message to screen - possible in Weblogic, is it poss
peterj Mar 12, 2009 12:38 PM (in response to valatharv)Did you see this post: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152200
-
5. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 12, 2009 4:25 PM (in response to valatharv)Thanks a lot Peter, looks good.
I will investigate it and try to implement. -
6. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 24, 2009 5:08 PM (in response to valatharv)Hi,
As per previous post I need to provide an interface and display the content of server.log/ application.log on Browser.
We are using jboss-4.2.3. I am trying to follow the post as suggested but need help, I think there is no profile.xml for 4.2.3 version.
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152200
Summary:
a) Server and application logs are generated under "jboss-4.2.3\server\default\log"
As per last post in above link
b)I used the existing log directory and created a new log.war directory in it.
Does it mean that I should create log.war directory under "jboss-4.2.3\server\default\log"
c)Then I added the log directory to the applicationURIs and put web.xml and jboss-web.xml into log.war/WEB-INF.
Not able to find where to add applicationURIs.
Please help to get started.
Regards
Val -
7. Re: Log message to screen - possible in Weblogic, is it poss
peterj Mar 24, 2009 6:37 PM (in response to valatharv)b) No, those are part of the instructions if you are using AS 5.0.x. For 4.2.3, follow the steps outlines by the first posting in http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152200
c) That is because it is 5.0.x-specific. -
8. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 24, 2009 8:30 PM (in response to valatharv)Thanks a lot for replying...
I know I am doing some basic wrong... :(
I added the following tojboss-4.2.3\server\default\deploy\jboss-web.deployer\server.xml
<Service name="jboss.web"> ...... <Context path="/logfiles" docBase="log" debug="0" reloadable="true" /> .....
Restarted Jboss, but how can I access server.log using URL... ? -
9. Re: Log message to screen - possible in Weblogic, is it poss
peterj Mar 25, 2009 1:25 PM (in response to valatharv)The URL should be http://loclahost:8080/log/server.log
But that will work only if you changed the JBoss AS logs to go into the /logfiles directory. If not, you need to change the path setting to the full path to the log directory. -
10. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 25, 2009 3:35 PM (in response to valatharv)I performed these steps but no success, please suggest what I am doing wrong :
a) jboss-4.2.3\server\default\conf\jboss-log4j.xml
server.log is getting created under "jboss-4.2.3\server\default\logfiles"<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="Threshold" value="INFO"/> <param name="File" value="${jboss.server.home.dir}/logfiles/server.log"/> <echo message="${jboss.server.log.dir}" /> <param name="Append" value="false"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> </layout> </appender>
b) jboss-4.2.3\server\default\deploy\jboss-web.deployer\server.xml<Connector port="80" address="${jboss.bind.address}" maxThreads="250" maxHttpHeaderSize="8192" emptySessionPath="true" protocol="HTTP/1.1" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <Context path="/logfiles" docBase="log" debug="0" reloadable="true" />...........
c) Tried URLhttp://localhost/log/server.log
-
11. Re: Log message to screen - possible in Weblogic, is it poss
peterj Mar 25, 2009 5:32 PM (in response to valatharv)As I said, the path value must be the full path to the log file directory, specifying "/logfiles" assumes that the directory is at root of the file system. What you really need is:
path="/full/path/to/jboss-4.2.3/server/default/logfiles" -
12. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 26, 2009 10:43 AM (in response to valatharv)Here is the summary, I tried changing the context path (I am trying on windows environment)... but no success
I think I am doing something wrong with context path, please guide.
a) jboss-log4j.xml<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="Threshold" value="INFO"/> <param name="File" value="${jboss.server.home.dir}/logfiles/server.log"/>
This genereates server.log file under "C:\jboss-4.2.3\server\default\logfiles"
b) Added context path to server.xml (for testing provided the full path)
C:\jboss-4.2.3\server\default\deploy\jboss-web.deployer\server.xml<Connector port="80" address="${jboss.bind.address}" <Context path="C:\\jboss-4.2.3\\server\\default\\logfiles" docBase="log" debug="0" reloadable="true" />
....
Tried URL :http://localhost/log/server.log
-
13. Re: Log message to screen - possible in Weblogic, is it poss
peterj Mar 26, 2009 12:53 PM (in response to valatharv)Swap the "path" and "docBase" settings. The "path" is the URL context name, and docBase is the location of the files on your system. (It helps to read the documentation...)
Then, move the "Context" tag inside the "Host" tag.... <Host ...> <Context docBase="C:\\jboss-4.2.3\\server\\default\\logfiles" path="/log" reloadable="true" /> </Host> ...
-
14. Re: Log message to screen - possible in Weblogic, is it poss
valatharv Mar 26, 2009 2:48 PM (in response to valatharv)Great, thanks a lot Peter now I can see the logs on browser.
Just a small help, I can see the logs but it is not formatted very difficult to read as compared to when we open server.log in some editor.
Is there any parameter or settings I should go for.