I am writing a non Android JNI program, and the java side is using log4j for logging. Can I use log4cxx or log4cpp on the C++ side and share the same config as java, so that the native log will be stored in the same file? Are there any downside of doing this?
Can I use log4j in Java and log4cxx in C++ in a JNI project to store log in the same file?
521 Views Asked by mebite At
1
There are 1 best solutions below
Related Questions in LOGGING
- Is Log4j2 xml configuration case sensitive?
- Logback stopped logging after splitting shared config file
- logging setup best practices
- C Simple Logging Management
- OpenShift Pyramid logging to file
- Log of dependency does not show
- Node/Express access logger from request object
- How does one locate all git log messages in the git object database?
- Logging error when executing Maven SonarQube plugin
- refactor 'execute and log' pattern
- CMD specifying columns to save?
- How to get information about error from HttpContext in WCF services
- Django not logging all errors
- Empty space at beginning of rsyslog log file
- Avoid log trace of external framework J2EE
Related Questions in JAVA-NATIVE-INTERFACE
- Generating scip.jar file (mac)
- NewStringUTF() with threads
- How can I assign the NULL to a float/double variable?
- Can I cast native primitive type into a JNI primitive type without worrying about endianness?
- Android NDK code (jni interface)
- Exception Access Violation
- SCIP JNI (Java Native Interface) installation on Ubuntu 14.04:
- How to manipulate CameraPreview bytearray through the JNI? (OpenCV)
- Hide GPS icon while GPS is on in android?
- How to send (from Native code) a android.content.Context parameter to a Java fct (via JNI)
- How to pass java object reference from java side to c++ side?
- How to update Android jni code changings
- Jni : Call a java method within C++ code, errors
- Android NDK: Multiple definition of .o and .c files
- Must I DeleteLocalRef an object I have called NewGlobalRef on?
Related Questions in LOG4J
- Set log4j.properties for GWT
- JENKINS Maven Build Failure
- Is Log4j2 xml configuration case sensitive?
- slf4j mechanism of loading its impl
- How do I redirect a 3rd partly log4j message to my own DailyRollingFileAppender?
- How to initialize the log4j system properly?
- Custom Converter with log4j2 and Mule not working
- log4j config issue with socket appender
- can't enable logging of spring framework
- How can Change log4j configuration file path?
- How to configure Log4j (1 or 2) to use custom log file name while code against Slf4j
- Log4j Logger not logging in some methods
- Performance Impact of logging class name , method name and line number
- Log4j unable to include project build directory in Local classpath in maven War project
- How to set a system property for the log4j2 JUL adapter in an OSGi environment
Related Questions in LOG4CXX
- Defining custom filters with log4cxx
- C++ Logging Library Setup
- Log4cxx and full file paths when used with CMake
- How to turn off logging in log4c, which is the configuration parameter used in xml file
- LGPL/public-domain equivalent of Apache log4cxx?
- I am getting error in c++ programm while using log4cxx
- C2252 Error when building log4cxx
- Logging to windows event using Log4cxx
- Process safe logging library for c++
- Add process id to log file name in log4cxx
- different loggers used with libraries
- Log4xx as Cocoa framework?
- log4cxx undefined reference to `log4cxx::Logger::getLogger(char const*)'
- The size of the generated library significantly increased after referencing -llog in the C++ code
- compile errors log4cxx with __stdcall and Boost 1.47.0
Related Questions in LOG4CPP
- log4cpp crashing while loading properties file
- C++ Logging Library Setup
- compiling log4cpp with custom toolchain
- Linking log4cpp library to project with cmake
- log4cpp stops working properly after sometime
- Undefined reference to log4cpp (GENIE generator installation error message)
- Log4cpp: Print date in UTC/GMT time zone
- how to set configuration of log4cpp for visual studio 2008
- Log4cpp record log repeatly
- Trouble understanding how to store an instance of a log4cpp logger in a class
- ETW tracking from .net, user mode and driver
- compile log4cpp for visual studio 2005
- SWIG tcl : undefined symbol error for log4cpp wrapper
- configure log4cplus to log to custom file at runtime
- log4cpp - no default constructor exists for log4cpp::AppenderSkeleton
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This may or may not work as intended depending on how complicated your config file is. For example, you could potentially have an issue where your file rolls over, and things could get out of sync between the log4cxx side and the log4j side.
The secondary problem that you may have is that log4cxx and log4j2 use different config file formats; this would only work if you use log4j 1.x.
What I have done in the past is to simply create a logger inside of the class that I will call from the JNI code; this solves the issue by always using a Java logger even from inside the JNI code. The downside is that this won't work if your JNI code is very complex. Here is a project that I created a while ago with some utility functions to help perform this task which may help you to get started.