• No results found

The main subsystems that use logging services are: Server Logs Domain Logs Transaction Logs HTTP Logs

N/A
N/A
Protected

Academic year: 2021

Share "The main subsystems that use logging services are: Server Logs Domain Logs Transaction Logs HTTP Logs"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

LOGGING SERVICES IN WEBLOGIC

Weblogic components or subsystems generate log files containing information that record all types of events or messages such as startup and shutdown information, deployment of new applications, failure of one or more subsystems, errors occurred, warning messages, and access information on HTTP requests.

Generally Logs can be help in the discovery of:

1) Any problems encountered while servicing or executing the requests on server 2) Records servers activity on daily including time intervals

3) The IP addresses of users accessing an application

4) Frequently accessed resources or subsystems or components 5) The amount of data sent and received

 These log messages are generated by the Oracle WebLogic Server instances/servers, subsystems, and Java EE applications that run on Oracle WebLogic Server or on client JVMs

 Debugging can also be enabled on individual subsystems to include additional information to trace out the problems

The main subsystems that use logging services are:

 Server Logs

 Domain Logs

 Transaction Logs

 HTTP Logs

Different Server Logs:

There are different types of Server logs generated in weblogic system.

Server_name.log

Server_name-diagnostic.log Server_name.out

Domain_name.log Application_name.log Access.log

Transaction Logs

Server_name.log: Logs all on going activities on server and keeps records of all messages. Subsystems and applications generate log messages to communicate its status.

The below one is an example of a message in a log file: which includes the #### prefix and Timestamp, Severity, Subsystem, Server Name/Machine Name/Thread ID, User, Transaction ID, Message ID or catalog ID, Message Text.

####<Nov 11, 2002 2:07:57 PM EST> <Notice> <WebLogicServer> <MyComputer>

<MedRecServer> <main> <kernel identity> <> <BEA-000360> <Server started in RUNNING mode>

By default Server logs are stored in DOMAIN_HOME/servers/server_name/logs/

(2)

Server_name-diagnostic.log: This log file records mainly information related to applications deployed on server and their errors messages.

Server_name.out: It will be generated If you use Node Manager to start Managed Server from WebLogic server administration console otherwise stdout or stderr messages written to a server_name.log.

The server log records information about events such as the startup and shutdown of servers, the deployment of new applications, or the failure of one or more subsystems and it may include startup information such as JVM heap and the CLASSPATH settings as well as runtime infrastructure issues errors. And includes all JDBC and JMS logs The below one is example:

<Nov 11, 2002 2:07:57 PM EST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

Domain_name.log: The domain log file provides a central location from which to view the overall status of the domain and resides in the administration server logs directory. The default name and location for the domain log file is DOMAIN_NAME/servers/ADMIN_SERVER_NAME/logs/DOMAIN_NAME.log

Application_name.log: These custom logs will be generated by specific applications deployed on server if it is defined by developer and contains messages or information or errors to that particular application only.

Access.log: Separate log file called access log record all HTTP requests processed by the server because server does not store HTTP requests in the server log file or the domain log file. The access logs contains basic information about every HTTP requests or transactions handled by the server, applications are being accessed and by whom. This can be achieved by enabling HTTP logging and it enabled by default.

The format contains the below following fields: Host name, Remote log name, Remote user and time, Request, Response code or status, Number of transferred bytes

Configuration for access.log: Environment > Servers > select any server > Logging > HTTP Example:

10.37.20.201 - - [26/Jun/2014:23:29:34 +0200] "POST /app-app/IncomingService HTTP/1.1" 200 991

Transaction Logs: Each server instance, including the administration server, has a default store which is a file-based or Database store, each server has a transaction log [TLOG] which stores information about committed or uncommitted transactions in persistence store. WebLogic Server uses the transaction log when recovering from system crashes or network failures. Using the transaction information from the transaction logs, the server makes an attempt to complete all in-flight, uncommitted transactions from the time the server failed. Ex: WLS_WLS_OSB2000000.DAT

Locate or configure default persistent store for Transaction Recovery -Weblogic console: +Servers >

Server1 > Configuration > Services: Default store section.

Note: “One cannot directly view the transaction log – the file is in a binary format”.

(3)

Log Level or Message Severity

The log levels of log messages from WebLogic Server subsystems, starting from the lowest level of impact to the highest

Messages range

There are will be catalog numbers for every message for component or subsystem which is below are the few message ranges for components, reference taken from WebLogic version 10.3.3

Message Catalog Cross-Reference

“BEA-280060” is called a “message catalog number” which will be help mostly for to find out the cause and action needs to be taken for an issue. BEA-code can search in google to find out the description of it.

Below is example of BEA-280060 catalog number:

(4)

CONFIGURING ROTATION AND VIEWING LOGS FROM CONSOLE

By default, WebLogic comes with standard log configuration and Rotation. if you need to configure or modify the existing values below are the steps:

To configure logs:

1) Login into WebLogic Console > Environment >select Servers.

2) In the Servers table, click the name of the server instance whose logging you want to configure.

3) Select Logging > General.

4) Retain or modify the default values.

Log Rotation:

 Log rotation is useful to prevent excessive log file growth.

 Rotation mechanism is done by types, we can enable only one type at a time.

1) Size based 2) Time interval based

 Each time when server log file reaches its defined size or time based, the server renames the current log file and creates a new SERVER_NAME.log to store new messages.

 By default, in production mode weblogic rotates log file on sized based with limit 5 MB in size.

That means when log file reaches 5 MB in size then it creates a new file

 In development mode by default Log file are rotated at server startup

Configuring Log Rotation:

From above after navigating to General tab you will find “Rotation” section. Here you can make changes to Rotation type By Size or By Time.

To rotate Domain Logs: Click on Domain Structure (domain_name) > Logging.

 For size based you need to specify the file size and for Time based need to specify the Rotation interval

Note:

1) You need to restart the servers to take changes effect for log rotation

2) Log rotation of server_name.out should be done by manually using shell scripts if needed 3) By default server_name.log is 5MB and server-diagnostic.log is 10MB in size.

(5)

To view logs from weblogic console:

Log files can be viewed from weblogic console rather than unix terminals but we cannot view as best as from terminals.

1) Login to WebLogic Console > Expand Diagnostics > Select Log Files.

2) In the Log Files table, select the radio button next to the name of the log you want to view.

3) The page displays the latest messages or contents of the log file; up to 500 messages in reverse 4) Select the radio button next to the log record you want to view.

CONFIGURING LOG FILTERS

The WebLogic Server provides the facility of filtering the messages i.e., omits or skips the specified messages from server log while server writes the messages. This can be achieved by below techniques.

1) Changing the Log Level for Loggers.

2) Setting a Message Filter for Loggers.

1) Changing the Log Level for Loggers: By default logger publishes messages of all severity levels from lowest to highest impact DEBUG, INFO, WARNING, ERROR, NOTICE, CRITICAL, ALERT, EMERGENCY.

For example, suppose if you set a Logger level to NOTICE, the Logger publishes only type of NOTICE, CRITICAL, ALERT, EMERGENCY messages only.

There are separate settings for Server Log file, Standard out log and Domain Log which can be change log level individually from WebLogic administration console.

1. Login to weblogic console > Environment and select Servers.

2. Under Servers, click the name of the server instance whose logging you want to configure.

3. On the Logging: General page, click Advanced.

4. Under Message Destinations sections:

2) Setting a Message Filter for Loggers: When you set log level filter on logger it effects on all handlers or subsystems but when you set a message filter on a logger that affects only the behavior of the specific handler.

(6)

Example: below are the steps for creating a log filter to avoid message “oracle.jps.deployment” from log file and applying the created filter to logger and this can be applied from weblogic console.

1. Login to weblogic console > domain_name > Configuration Tab > log Filters SubTab.

Another Example of Log filter for filtering out all messages containing the Message Id “320114”

(MSGID != ‘320114’)

(7)

Applying created log filter: After creating the Log filter like above it can be applied from below steps.

Navigate to: Environment > Servers > Select any server > Logging Tab > General SubTab. > Advanced

Expand > Advanced

From the above, you can set the created LogFilter from list to apply the rule. This can be set individually for Server.log, Server.out and Domain logs.

Below is the chart of column names that can be used for log filter.

WLDF: [Weblogic Diagnostics Framework]

A WLDF also can be used for log filtering which includes a query language for constructing watch rule expressions, Data Accessor query expressions, and log filter expressions. The syntax is a small and simplified subset of SQL syntax.

WebLogic SNMP LogFilter Configuration:

SNMP is Simple Network Management Protocol (SNMP) which can be used for Log filtering and monitoring weblogic servers

For above topics please go through the Oracle documents if you want learn on this [Not explained in this document]

(8)

DEBUG LOGS ON SERVER:

Weblogic server provides debugging the subsystems or components to avail additional information when a problem exists on server. This can be set from weblogic console dynamically without any restarts this helps to fix the servers issues easily.

For example if you are facing issues or problems with JDBC connection, to know additional information causing problem with JDBC connection then DEBUG can be enabled from weblogic console.

Steps:

1) Login to weblogic console > Environment > Servers [select any Server] > Debug Tab.

2) Select the component to DEBUG in this example selecting JDBC Conn and push the “Enable” button to activate dynamically.

NOTE:

1) Debug can be enabled and disabled dynamically either from +Default or +Weblogic from debug Tab at any time for sub components provided by WebLogic server

2) When DEBUG is enabled the logs will be generated or rotated with in short period of time due to server writes additional information in logs and this causes more disk usage, so please check the storage capacity before you enable the debugging

3) Best practice is to stop the debugging logs after collecting the additional information from logs from troubleshooting process.

(9)

LOGGING IN SOA:

Most Oracle Fusion Middleware components write diagnostic log files in the Oracle Diagnostic Logging (ODL) format. This means ODL logs entries in a consistent, structured way using predefined fields and name/value pairs.

 ODL-formatted log files can be viewed through the Web-based Oracle Enterprise Manager which gives more flexible on logs to work with them.

 The entries are written to the server diagnostic log file and you can download them on client system

 The ODL framework provides support for managing log files, including log file rotation. The maximum log file size and the maximum size of log directories can also be defined

Log Configuration:

Log configuration done by through

1) SOA EM Console 2) Through WLST command 3) Editing logging.xml

1) SOA EM Console:

Log configuration can be done to particular server (For ex: only for admin server or SOA server), just you need to do is Right-click on that particular server from weblogic domain in SOA EM Console and select

“Log Configuration”

This page is to configure basic and advanced log configuration settings.

(10)

Types of Loggers in SOA:

There are two types of loggers in SOA 1. Runtime loggers

2. Persistent loggers

1. Runtime loggers: Runtime loggers are activated automatically or dynamically when changes are made to log level during runtime or become active when a particular feature area is used. But their log levels are not saved or remained after component or server restarts. To save modified log level settings even after restarts check the box of “Persist log level state across component restarts” as shown below.

2. Persistent Logger: “Loggers with persistent Log level state” those become active when a component or server is restarted. Their configuration details are saved in a logging.xml file and automatically their log levels are persisted or saved across component restarts.

Specify Custom Loggers:

For Example, Suppose desired loggers are not existed in Runtime or Persistent Loggers after your search they can be added manually from “Specify Loggers” section by giving Logger name and Diagnostic level but to affect these settings servers need restart.

References

Related documents

community composition using direct 454-pyrosequencing of ribosomal RNA (rRNA) gene targets. Our overall goal was to simultaneously analyze community dynamics of bacteria and fungi

The objective of a graduate educational program in medical physics is to provide its graduates with the basic and applied scientific knowledge that is necessary both for

✤ IOKit can share data directly with user space apps. ✤ Assume user space apps know the structure

For not having to annotated every map element as an instance of a Creative Work first, or use the auxiliary properties named additionalProperty or

The unit of Laboratories and central Validation of the Quality Management is responsible for the development of the tasks of testing and validation of project in Grupo

 HP  did  receive  strong  scores  on  virtualization  management,  based  on capabilities  to  manage  dynamically  assembled  HVDs,  as  well  as  a

Abbreviations and acronyms: ABCD, Appropriate Blood pressure Control in Diabetes; ABI, ankle-brachial index; ABPM, ambulatory blood pressure monitoring; ACCESS, Acute

However, a more nuanced question is whether contemporary information and communication technologies (ICTs) such as computers and mobile phones are engendering new ways for us