distributed logging in java with constrained resource usage sunil brown varghese, daniel andresen...

26
Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State University

Upload: kayli-nott

Post on 16-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Distributed Logging in Javawith Constrained Resource Usage

Sunil Brown Varghese, Daniel Andresen

Dept. of Computing and Information Sciences

Kansas State University

Page 2: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Overview

Introduction to Logging Distributed Logging Distributed Logging with RMI Conclusions

Page 3: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Introduction

Everyone logs in one way or other… print(), out, System.out.print() are examples

of console logging Large systems like aircraft monitoring

systems, transaction–based financial processes may log into multiple targets

Page 4: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Advantages of Logging

Feedback to developers during development cycles

Provide system diagnostic alerts from production systems

Provide information for statistical analysis of working of a system

Delivery based on levels of importance could improve efficiency in development cycle

Page 5: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Logging options

The Log4J Project Logging Toolkit for Java from IBM Java 2 Standard Edition (v1.4.0 onward)

Page 6: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Distributed Logging

Page 7: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Distributed Logging

Log4j has good support for sending log messages to multiple log servers by TCP/IP socket connections

J2SE provides the Java Logging framework by default and supports distribution of log messages by socket connections (though listeners are left to the developer)

Page 8: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Java Logging Framework

Page 9: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Observation effects the Observed

If generated at a high rate, distributed log messages may swamp the processor and the network connections whereby decreasing system performance and the accuracy of the log analysis

Solution: Limit the use of distributed log messages to critical and non-repetitive sections of code and buffer messages

Page 10: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Distributed Logging with RMI

Transmission of Log messages with RMI calls allows the log objects to be recorded at remote sites as is

Log messages may be modified easily ( say based on network load, exception objects may be removed from log)

Page 11: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Representation

Page 12: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Extending the Java Logging Framework

RMI Handler extended from Handler class ensuring compatibility with Logger and security in-built into Java Logging

The logging levels may be varied dynamically against bandwidth usage by providing level information in an XML file

Page 13: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Class View – Client Side

Page 14: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Class View – Server Side

Page 15: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Sample Levels.xml file

<?xml version='1.0'?> <param-list> <cutoff>1600</cutoff> <cutoff>1400</cutoff> <cutoff>1200</cutoff> <cutoff>1000</cutoff> <cutoff>800</cutoff> <cutoff>600</cutoff> <cutoff>500</cutoff> </param-list>

Page 16: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

RMI Log Server

Instantiates a logger and assigns the RMI Handler and other Handlers based on an XML file

Server binds to the specified machine and port (binding data from input XML file)

This framework allows a chain of RMI Servers to be formed connected by RMI Handlers in a tree fashion

Page 17: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Bandwidth Computation

TCP/IP based weighted average method is used to update bandwidth

Bandwidth is sampled for a Sampling Time and it is reset for a fresh start

If there is no bandwidth updates for an Inactivity Tolerance period, the Bandwidth is reset

Page 18: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

RMI Log Buffer

The RMI Handler may buffer the log messages so as to reduce the number of RMI calls needed. This could dramatically raise the efficiency of transmission

The RMI Buffer ensures message transmission under normal RMI Handler operation and abnormal termination

Page 19: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

RMI Log Server GUI

The GUI connects to RMI Log Server and provides time graphs of bandwidth statistics

The cutoffs along with bandwidth variance are shown

Page 20: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

RMI Log Server GUI

Page 21: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

RMI Log Server GUI Connection

As there isn’t a unique naming scheme for RMI Handlers connected to a logger, the URL and port information is used as RMI Handler identifier

Page 22: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

RMI Log Server GUI Connection

Page 23: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Limitations / Assumptions

Leveling thresholds at the RMI Handler level are to be set intuitively by the user

Log message sizes were taken as constants for testing purposes

The overhead of making an RMI call is heavier than sending data through TCP/IP sockets

Page 24: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Conclusions

RMI Logging allows the recreation of log messages in remote sites as long as all sub-components are serializable

Allows the exception objects to be stored in remote repositories

RMI Handler can monitor its bandwidth usage and discard log messages of low level

Page 25: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Future work

RMI Handler may maintain a server list so that if one RMI Log Server fails, it retransmits to secondary servers

The GUI interface can be developed further to remotely control RMI Log Servers

Page 26: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State

Questions ?