create account

SteemJ V0.4.0 Feature Preview – Logging by steemj

View this thread on: hive.blogpeakd.comecency.com
· @steemj ·
$107.13
SteemJ V0.4.0 Feature Preview – Logging
*SteemJ v0.4.0 will finally allow you to choose the logging framework of your choice.*

<center>
![SteemJV2Logo](https://imgur.com/bIhZlYT.png)
</center>

# SteemJ V0.4.0 Feature Preview – Logging

Hello Steemians!

The development of SteemJ in version 0.4.0 is going on and some big features are planned. I will use this series to give you a small preview of what will come.  Today`s post is about the changes related to the logging.

# Logging
Prior to SteemJ version 0.4.0, SteemJ was shipped with a logging framework implementation. As this is a bad practice for several reasons, SteemJ 0.4.0 removed this implementation and allows you to configure the logging on your own. 

To achieve this, SteemJ only contains the <i>slf4j-api</i> and expects you, to add the slf4j implementation of your choice to your project. A list of the most common implementations can be found at [www.slf4j.org/manual](https://www.slf4j.org/manual.html), while you can find a lot more in the "vastness of the internet".

# Example Configuration
One good example of an alternative slf4j implementation is <b>log4j-slf4j-impl</b>, which implements the slf4j-api and adds the powerfull configuration options of log4j2. 

As a first step, the log4j-slf4j-impl jar needs to be added to your project. The most easiest way to achieve this is the usage of a Build-Management tool like Maven, because you only need to add the required dependencies the pom.xml. 

```XML
<dependency>
	<groupId>eu.bittrade.libs</groupId>
	<artifactId>steemj-core</artifactId>
	<version>${steemJ.version}</version>
</dependency>
<dependency>
	<groupId>org.apache.logging.log4j</groupId>
	<artifactId>log4j-slf4j-impl</artifactId>
	<version>${log4j.version}</version>
</dependency>
<dependency>
	<groupId>org.apache.logging.log4j</groupId>
	<artifactId>log4j-core</artifactId>
	<version>${log4j.version}</version>
</dependency>
```

To finalize the logging configuration of your project, create a <i>log4j2.xml</i> and add it to the <i>src/main/resources</i> folder. An example <i>log4j2.xml</i> configuration is shown below.

```XML
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
	<Appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
		</Console>
	</Appenders>
	<Loggers>
		<Logger name="eu.bittrade.libs.steemj" level="WARN">
			<AppenderRef ref="Console" />
		</Logger>
		<Logger name="my.project" level="DEBUG">
			<AppenderRef ref="Console" />
		</Logger>
		<Root level="ERROR" />
	</Loggers>
</Configuration>
```

The configuration above would append all log messages of:
* SteemJ, that have a severity of <b>WARN</b> or higher
* your project (package my.project), that have a severity of <b>DEBUG</b> or higher
to the console, while ignoring all other log messages, because no logger is defined for <i>Root</i>.

If you want to use log4j2 in your project too, you should have a look at the [official documentation](https://logging.apache.org/log4j/2.0/manual/configuration.html) to find detailed configuration examples.

# General information
## What is SteemJ?
SteemJ is a project that allows you to communicate with a Steem node using Java. So far, the project supports most of the API calls and is also able to broadcast most of the common operation types. Further information can be found on [GitHub](https://github.com/marvin-we/steem-java-api-wrapper).

> https://github.com/marvin-we/steem-java-api-wrapper

## How to add it to your project?
SteemJ binaries are pushed into the maven central repository and can be integrated with a bunch of build management tools like Maven. The [Wiki](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project) provides a lot of examples for the most common build tools. If you do not use a build management tool you can download the binaries as described [here](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project#download).

## Contribute
The project became quite big and there is still a lot to do. If you want to support the project simply clone the git repository and submit a pull request. I would really appreciate it =).

> git clone https://github.com/marvin-we/steem-java-api-wrapper.git

## Get in touch!
Most of my projects are pretty time consuming and I always try to provide some useful stuff to the community. What keeps me going for that is your feedback and your support. For that reason I would love to get some Feedback from you <3. Just contact me here on [Steemit](https://steemit.com/@dez1337) or ping me on [GitHub](https://github.com/marvin-we/steem-java-api-wrapper).

<hr>

<center>If you want to stay up to date or just like the stuff I am doing it would be great if you could press the button below =).
<br>

| Follow me  | Follow @dez1337 |
| ------------- | ------------- |
| [![follow me](https://steemitimages.com/0x0/https://steemitimages.com/0x0/http://imgur.com/n1bWw14.png)](https://steemit.com/@steemj)  | [![follow dez1337](http://imgur.com/GlepNAo.png)](https://steemit.com/@dez1337) |

<br>

Thanks for reading and best regards,
@dez1337
</center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorsteemj
permlinksteemj-v0-4-0-feature-preview-logging
categorysteemdev
json_metadata{"tags":["steemdev","steem","java","programming","steem-dev"],"users":["dez1337"],"image":["https://imgur.com/bIhZlYT.png","https://steemitimages.com/0x0/https://steemitimages.com/0x0/http://imgur.com/n1bWw14.png","http://imgur.com/GlepNAo.png"],"links":["https://www.slf4j.org/manual.html","https://logging.apache.org/log4j/2.0/manual/configuration.html","https://github.com/marvin-we/steem-java-api-wrapper","https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project","https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project#download","https://github.com/marvin-we/steem-java-api-wrapper.git","https://steemit.com/@dez1337","https://steemit.com/@steemj"],"app":"steemit/0.1","format":"markdown"}
created2017-09-03 16:41:45
last_update2017-09-03 16:41:45
depth0
children6
last_payout2017-09-10 16:41:45
cashout_time1969-12-31 23:59:59
total_payout_value81.548 HBD
curator_payout_value25.581 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,173
author_reputation1,153,292,944,592
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,759,524
net_rshares29,180,756,416,643
author_curate_reward""
vote details (40)
@chandankumar007 ·
$0.07
Good job bro...
👍  , ,
properties (23)
authorchandankumar007
permlinkre-steemj-steemj-v0-4-0-feature-preview-logging-20170903t191116944z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-09-03 19:11:24
last_update2017-09-03 19:11:24
depth1
children0
last_payout2017-09-10 19:11:24
cashout_time1969-12-31 23:59:59
total_payout_value0.064 HBD
curator_payout_value0.010 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation71,702,339,729
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,772,332
net_rshares20,877,514,196
author_curate_reward""
vote details (3)
@discernente ·
$0.22
Keep the good work. I am starting to use it with good results.
👍  , ,
properties (23)
authordiscernente
permlinkre-steemj-steemj-v0-4-0-feature-preview-logging-20170903t164941096z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-09-03 16:49:27
last_update2017-09-03 16:49:27
depth1
children0
last_payout2017-09-10 16:49:27
cashout_time1969-12-31 23:59:59
total_payout_value0.206 HBD
curator_payout_value0.009 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length62
author_reputation569,779,453,117,908
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,760,186
net_rshares59,296,363,151
author_curate_reward""
vote details (3)
@nutritionhealth ·
$0.07
Keep the good work. I am starting to use it with good results.👌👌👌👌👌👌👌👌👌👌
👍  ,
properties (23)
authornutritionhealth
permlinkre-steemj-steemj-v0-4-0-feature-preview-logging-20170903t175120992z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-09-03 17:51:24
last_update2017-09-03 17:51:24
depth1
children0
last_payout2017-09-10 17:51:24
cashout_time1969-12-31 23:59:59
total_payout_value0.057 HBD
curator_payout_value0.017 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length72
author_reputation-36,787,585,889
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,765,656
net_rshares21,027,674,699
author_curate_reward""
vote details (2)
@sontiogo ·
$0.21
Thanks man, good post. Keep it that way
Peace
👍  , , ,
properties (23)
authorsontiogo
permlinkre-steemj-steemj-v0-4-0-feature-preview-logging-20170903t175011436z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-09-03 17:50:09
last_update2017-09-03 17:50:09
depth1
children0
last_payout2017-09-10 17:50:09
cashout_time1969-12-31 23:59:59
total_payout_value0.173 HBD
curator_payout_value0.032 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length45
author_reputation366,797,798,494
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,765,550
net_rshares56,778,680,157
author_curate_reward""
vote details (4)
@themarkymark ·
$0.20
I don't use Java, but I love to see the API get better and more accessible.   Thanks for all your work!
👍  ,
properties (23)
authorthemarkymark
permlinkre-steemj-steemj-v0-4-0-feature-preview-logging-20170903t171917650z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-09-03 17:19:15
last_update2017-09-03 17:19:15
depth1
children1
last_payout2017-09-10 17:19:15
cashout_time1969-12-31 23:59:59
total_payout_value0.150 HBD
curator_payout_value0.047 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length103
author_reputation1,780,080,004,399,932
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,762,846
net_rshares54,603,797,021
author_curate_reward""
vote details (2)
@dez1337 ·
$0.24
Thank you very much for the positive feedback and for the support!
👍  
properties (23)
authordez1337
permlinkre-themarkymark-re-steemj-steemj-v0-4-0-feature-preview-logging-20170903t181007114z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-09-03 18:10:06
last_update2017-09-03 18:10:06
depth2
children0
last_payout2017-09-10 18:10:06
cashout_time1969-12-31 23:59:59
total_payout_value0.180 HBD
curator_payout_value0.059 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length66
author_reputation20,544,257,521,749
root_title"SteemJ V0.4.0 Feature Preview – Logging"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id13,767,239
net_rshares65,974,274,223
author_curate_reward""
vote details (1)