Tuesday Oct 09, 2012

JMS : Specifying Message Paging Directory on Weblogic server.

Two ways to configure or modify Paging directory, here the examples :

1.- Via config.xml file.

<paging-directory>C:\temp</paging-directory>

<jms-server>
<name>JMSServerMS1</name>
<target>MS1</target>
<persistent-store xsi:nil="true"></persistent-store>
<hosting-temporary-destinations>true</hosting-temporary-destinations>
<temporary-template-resource xsi:nil="true"></temporary-template-resource>
<temporary-template-name xsi:nil="true"></temporary-template-name>
<message-buffer-size>-1</message-buffer-size>
<paging-directory>C:\temp</paging-directory>
<paging-file-locking-enabled>true</paging-file-locking-enabled>
<expiration-scan-interval>30</expiration-scan-interval>
</jms-server>

-------------------------------------------------------


2 .- Via WLST (Weblogic scripting tool)


startEdit()
cd('/Deployments/JMSServerMS1')
cmo.setPagingDirectory('C:\\temp')
activate()

Rotating WebLogic Server logs to avoid large files using WLST.

By default, when WebLogic Server instances are started in development mode, the server automatically renames (rotates) its local server log file as SERVER_NAME.log.n.  For the remainder of the server session, log messages accumulate in SERVER_NAME.log until the file grows to a size of 500 kilobytes.

Each time the server log file reaches this size, the server renames the log file and creates a new SERVER_NAME.log to store new messages. By default, the rotated log files are numbered in order of creation filenamennnnn, where filename is the name configured for the log file. You can configure a server instance to include a time and date stamp in the file name of rotated log files; for example, server-name-%yyyy%-%mm%-%dd%-%hh%-%mm%.log.

By default, when server instances are started in production mode, the server rotates its server log file whenever the file grows to 5000 kilobytes in size. It does not rotate the local server log file when the server is started. For more information about changing the mode in which a server starts, see Change to production mode in the Administration Console Online Help.

You can change these default settings for log file rotation. For example, you can change the file size at which the server rotates the log file or you can configure a server to rotate log files based on a time interval. You can also specify the maximum number of rotated files that can accumulate. After the number of log files reaches this number, subsequent file rotations delete the oldest log file and create a new log file with the latest suffix.

 Note: WebLogic Server sets a threshold size limit of 500 MB before it forces a hard rotation to prevent excessive log file growth.

To Rotate via WLST :

#invoke WLST
C:\>java weblogic.WLST

#connect WLST to an Administration Servera
wls:/offline> connect('username','password')

#navigate to the ServerRuntime MBean hierarchy
wls:/mydomain/serverConfig> serverRuntime()
wls:/mydomain/serverRuntime>ls()

#navigate to the server LogRuntimeMBean
wls:/mydomain/serverRuntime> cd('LogRuntime/myserver')
wls:/mydomain/serverRuntime/LogRuntime/myserver> ls()
-r-- Name myserver
-r-- Type LogRuntime

-r-x forceLogRotation java.lang.Void :

#force the immediate rotation of the server log file
wls:/mydomain/serverRuntime/LogRuntime/myserver> cmo.forceLogRotation()
wls:/mydomain/serverRuntime/LogRuntime/myserver>

The server immediately rotates the file and prints the following message:

<Mar 2, 2012 3:23:01 PM EST> <Info> <Log Management> <BEA-170017> <The log file C:\diablodomain\servers\myserver\logs\myserver.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>

<Mar 2, 2012 3:23:01 PM EST> <Info> <Log Management> <BEA-170018> <The log file has been rotated to C:\diablodomain\servers\myserver\logs\myserver.log00001. Log messages will continue to be logged in C:\diablodomain\servers\myserver\logs\myserver.log.>

To specify the Location of the archived Log Files

The following command specifies the directory location for the archived log files using the -Dweblogic.log.LogFileRotationDir Java startup option:

java -Dweblogic.log.LogFileRotationDir=c:\foo
-Dweblogic.management.username=installadministrator
-Dweblogic.management.password=installadministrator weblogic.Server

For more information read the following documentation ;

Using the WebLogic Scripting Tool

http://download.oracle.com/docs/cd/E13222_01/wls/docs103/config_scripting/using_WLST.html

Configuring WebLogic Logging Services

http://download.oracle.com/docs/cd/E12840_01/wls/docs103/logging/config_logs.html



Friday Dec 09, 2011

Playing around - wlstonweb

I developed this tool I called wlstonweb, basically is a web application that emulate WLST (Weblogic scripting tool) on a web interface, this application has two main features :

1 .- Execute WLST commands Sessions via a web browser

2.- Run Scripts Management via a web browser and administrate them.

 Basically the tool was developed  by using the following components :

.- Servlets, JSP.

.- Ajax/Json.

.- Interpreter = Wrapper.

 This has the same concept of a chat room :

.- Send a message --> Keep the message --> Release the message.

Then we have an interpreter of the commands :

.- Send the command --> Keep the command and interpreter --> Release the results of the command.

and if we apply the MVC concept to this we have:

 .- Html page Ajax call --> Servlet --> Intepreter / retun json format--> Servlet reponse--> Html page json reponse.

That is the whole concept.

Session via web browser.

and we can use all the features provided by WLST on a web interface, that allow us to use simple or complex commands remotely without the necessity to stay on the same net where is located your weblogic server installation.


When I have time I'm going to explain step by step how I developed the tool and I will post part of the code and feel free to leave your comment and ideas to improve this tool.

Click here to download

Best regards

/Antonio.



About

Antonio De Juan Image

I was formerly a Senior Technical Support Engineer in the Middleware Application Server Team. I worked supporting Weblogic Server, Java EE, Jrockit, Coherence among other Oracle products.
You can find my new blog at :
http://antoniodejuan.wordpress.com/
Oracle WebLogic

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today