<commit_before># manfred-logger

This document describes Architecture and Design from manfred-logger component.

Architecture and Design

Requirements:
º Logger component should be used on any Java project.
º Logger server can receives messages from specific applications.
º Logger service must be as a cloud application.

Quality Scenarios:
1) Logger component should send Log information through Internet to remote server. It should work even when remote server is offline, persisting messages locally and sending when server is up again. Message should be sent asynchronously.
2) Logger server must receive messages from any logger application. An e-commerce application will send other messages as well and should be treated differently. This way the logger server must handle all logs that is received not interfering on each other.
3)Application that uses logger component should not be interfered (pausing, waiting some execution, etc). It should execute normally even when some error happens on logger component.

Restrictions:
Logger component must be created with Java.
Logger messages must be sent over network.

manfred-logger: component that contains logic to be used to log information.
manfred-business: contains business object logic. Business roles are inside this component, using BPO and DAO architecture.
manfred-framework: offers useful methods for all projects.
message-receiver: component that receives messages on server.
manfred-producer: component that sends messages on client.

Deployment diagram contains components that are useful for using manfred-logger component. Every component will be detailed below:

Application: Application that uses manfred-logger plugin.
Manfred-logger: library that contains logic to log messages on remote server.
Broker (ActiveMQ): on both nodes (application-server) it's the broker that sends log and receives acknowledge. It contains the logic that control this flow.
TCP (Log VO Object): Communication between Application and Server is TCP based, and contains the Object LogVO with relative log information.
Server: server where resides application that receives all log messages.
Application Queue: Queue that receives messages that is application based.
E-commerce Queue: Queue that receives messages related to e-commerce queue.
Cassandra Database: Database that stores log data.

Sequence Diagram

As it's message based, a sequence diagram will be shown below to show how logs are sent over network and processed. See next page.

Improvements on next releases

1) Send messages over HTTPS, using certificates.

2) Create license for applications that can use this logger (using a common key between client and server).

3) Create a Service that can receive requests from browser client using Json. This way, it can be added on Javascript with Ajax do send website information (as E-commerce example).

4) Create documentation on Log component for clients that are going to use.

5) Create unit test running integration between components.

6) A bug was found when adding logs that impacts on Quality Scenario “Application that uses logger component should not be interfered (pausing, waiting some execution, etc). It should execute normally even when some error happens on logger component.”. Client application hangs. It's necessary to close sender connections without interfering on other senders.

7) Add performance tests.

How to use manfred-logger (client).

1) To use, if it's a based maven project add this dependency:

<dependency>
    	<groupId>com.manfred.logger</groupId>
    	<artifactId>manfred-logger</artifactId>
    	<version>1.0-SNAPSHOT</version>
 </dependency>

Otherwise, add manfred-logger.jar on project dependency.

2) Create a logger.properties file on application, on src/main/resources defining:

#Application name that uses this logger
applicationName=Application.
#If it's a remote log, please define URL to Server Log.
#Example: IP:PORT, (192.168.0.1:6161)
loggerURL=localhost:61616<commit_msg>description<commit_after># manfred-logger

This document describes Architecture and Design from manfred-logger component.

**Architecture and Design**

Requirements:
º Logger component should be used on any Java project.
º Logger server can receives messages from specific applications.
º Logger service must be as a cloud application.

**Scenarios:**
1) Logger component should send Log information through Internet to remote server. It should work even when remote server is offline, persisting messages locally and sending when server is up again. Message should be sent asynchronously.
2) Logger server must receive messages from any logger application. An e-commerce application will send other messages as well and should be treated differently. This way the logger server must handle all logs that is received not interfering on each other.
3)Application that uses logger component should not be interfered (pausing, waiting some execution, etc). It should execute normally even when some error happens on logger component.

**Restrictions:**
Logger component must be created with Java.
Logger messages must be sent over network.

**Components**

manfred-logger: component that contains logic to be used to log
information. 
manfred-business: contains business object logic. Business roles are inside this component, using BPO and DAO architecture. 
manfred-framework: offers useful methods for all projects. 
message-receiver: component that receives messages on server.
manfred-producer: component that sends messages on client.

Deployment diagram contains components that are useful for using manfred-logger component. Every component will be detailed below:

Application: Application that uses manfred-logger plugin.
Manfred-logger: library that contains logic to log messages on remote server.
Broker (ActiveMQ): on both nodes (application-server) it's the broker that sends log and receives acknowledge. It contains the logic that control this flow.
TCP (Log VO Object): Communication between Application and Server is TCP based, and contains the Object LogVO with relative log information.
Server: server where resides application that receives all log messages.
Application Queue: Queue that receives messages that is application based.
E-commerce Queue: Queue that receives messages related to e-commerce queue.
Cassandra Database: Database that stores log data.

**Sequence Diagram**

As it's message based, a sequence diagram will be shown below to show how logs are sent over network and processed. See next page.

**Improvements on next releases**

1) Send messages over HTTPS, using certificates.

2) Create license for applications that can use this logger (using a common key between client and server).

3) Create a Service that can receive requests from browser client using Json. This way, it can be added on Javascript with Ajax do send website information (as E-commerce example).

4) Create documentation on Log component for clients that are going to use.

**How to use manfred-logger (client).**

1) To use, if it's a based maven project add this dependency:

       <dependency>
            	<groupId>com.manfred.logger</groupId>
            	<artifactId>manfred-logger</artifactId>
            	<version>1.0-SNAPSHOT</version>
       </dependency>

Otherwise, add manfred-logger.jar on project dependency.

2) Create a logger.properties file on application, on src/main/resources defining:

Application name that uses this logger

    applicationName=Application.

If it's a remote log, please define URL to Server Log.
Example: IP:PORT, (192.168.0.1:6161)

    loggerURL=localhost:61616
{'fraction_non_alphanumeric': 0.04860107710495205, 'fraction_numerical': 0.007749901484303165, 'mean_word_length': 4.785714285714286, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7160785', 'n_tokens_mistral': 1812, 'n_tokens_neox': 1723, 'n_words': 1032}