You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1d238e6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: java/README.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,73 @@ $ ant test
40
40
$ ant clean build test
41
41
```
42
42
43
+
###Configuring Logging
44
+
Pubnub implements swappable logging using SLF4J, which allows you to switch different logging frameworks easily. All the logging calls using SLF4J API will be delegated to the underlying logging framework.
45
+
46
+
Before you enable logging, you need to create a "debug-build" version of the Pubnub-StandardEdition.jar.
47
+
48
+
####To create a debug-build
49
+
50
+
1. Go to Terminal on Mac/Linux or command-line on Windows
51
+
2. Change directory to the Java folder where you have cloned the git java repo of pubnub (https://github.com/pubnub/java.git)
52
+
3. Type "ant debug-build"
53
+
4. The debug version of Pubnub-StandardEdition jar file (e.g Pubnub-StandardEdition-3.x.x.jar) will be created.
54
+
5. Add this jar as a reference in your project.
55
+
56
+
To implement logging using log4j you need to add the following references to the project. Using log4j you can log to console or a file or both.
57
+
58
+
1. slf4j-api jar file (e.g. slf4j-api-1.7.5.jar or a latest version) which is the SLF4J API
59
+
2. slf4j-log4j jar file (e.g. slf4j-log4j-1.7.5.jar or a latest version) which acts as a bridge between slf4j and log4j
60
+
3. log4j jar file (log4j-1.2.17.jar or a latest version), which provides the underlying logging framework
61
+
4. Along with these references you need to add the log4j.properties file in the CLASSPATH
62
+
63
+
For example, in your log4j.properties file, configure it to write the logs to a log file:
0 commit comments