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?
523 views Asked by mebite At
1
There are 1 answers
Related Questions in LOGGING
- ModuleNotFoundError: No module named 'src' while importing logging
- How to get domains in Shadowsocks server log with Shadowsocks Android
- How to enable log to console Cosmos Client SDK requests
- pino-pretty logging special characters as literal
- unable to serialize JSON type logs In fluentd(logging-operator)
- How to configure different loggers separately in structlog?
- detect catalina.out log path from a running tomcat on non-Windows
- apache2 rotatelogs creates log file but its empty when deployed to azure web app
- Ubuntu:24.04 Container generating excessive logs
- Transform Load pipeline for a logs system: Apache Airflow or Kafka Connect?
- Deisred log is not rotating
- Purpose of setting debug="false" in log4j at configuration level
- RobotFramework hangs after xx lines of log
- logging in multiprocess writes to same log
- Masking in logback.xml with all request and responses
Related Questions in JAVA-NATIVE-INTERFACE
- How can I disable JVM bytecode verification at runtime?
- What is the cost of Java's native methods?
- How to get all windows from all applications with Java
- I don't know how to solve "local reference table overflow" error in android JNI
- Invoke jar from C++ using JNI
- JNI - Call java method with a Functional Interface parameter from cpp
- JNI crate. How pass -XstartOnFirstThread option to jvm?
- Is there way to determine the path that was picked from java.library.path?
- What is the exactly time that JNI release the LocalReference automatically?
- AndroidBitmap_lockPixels() and SWIG
- Loading OpenCV with System.load("path/to/opencv") fails on Windows, works on Linux
- Unable to find JNI function with frida (android)
- Best practice for loading native library async
- R embedded in java (JNI) : C stack usage 134897775268 is too close to the limit / Fatal error: unable to initialize the JIT
- Compiling libR (from the R statistical package) as a standalone C library for java+jni
Related Questions in LOG4J
- Purpose of setting debug="false" in log4j at configuration level
- log4j-api 2.20.0 causing : java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.util.PropertiesUtil
- log4j2 CronTriggeringPolicy results incorrect date in filename along with SizeBasedTriggeringPolicy
- Log4j is not writing logs into file
- How to print hudi logs in aws emr serverless application
- Is there a way to color-code Log4J2 in Windows Powershell?
- Not able to change the logging level log4j on Payara server
- How to implement log4j in IBM BPM?
- How can I change logger pattern?
- Log4J 2 - Each run has its own unique folder to store logs, and automatically delete old logs/folders
- Disable default logging in /opt/engine.log
- Native Compile java.lang.NoSuchMethodException: org.apache.logging.log4j.message.DefaultFlowMessageFactory.<init>() exception for apache-poi
- log4j 1.2.x outputs JSON format
- log4j java - dynamic logger creation in multi-thread environment
- Log4j is not accessible in eclipse
Related Questions in LOG4CXX
- The size of the generated library significantly increased after referencing -llog in the C++ code
- log4cxx undefined reference to `log4cxx::Logger::getLogger(char const*)'
- Log4cxx producing error in log4cxx/logger.h
- log4cxx add filter to specific logger programmatically
- Failed to process package 'rosconsole':
- How can I get the logging directory of a RollingFileAppender from log4cxx?
- is log4cxx supports http or https appenders?
- log4cxx logger modification in docker container
- Log4cxx Error. Please initialize the log4cxx system properly
- Writing custom log4cxx policy, linker can't find log4cxx::helper::Object::cast
- Building Apache log4cxx with CMake
- log4cxx::AsyncAppender, All logs are not logged before exiting
- ostringstream error with log4cxx and c++11
- ROS rosconsole.config logging configuration file in common XML?
- Is it possible to configure spdlog from a file like log4j or log4cxx?
Related Questions in LOG4CPP
- Why is log4cpp not writing to file when using systemctl
- does vcpkg incorrectly delivers an old version of log4cpp?
- linking with log4cpp fails with Raspian Bullseye
- Access violation writing location when using log4cpp
- compile log4cpp for visual studio 2005
- Can I use log4j in Java and log4cxx in C++ in a JNI project to store log in the same file?
- log4cpp stops working properly after sometime
- Log4cpp: Print date in UTC/GMT time zone
- C++ Run time Linker error (liblog4cpp.so.5) Eclipse
- Trouble understanding how to store an instance of a log4cpp logger in a class
- MSB3073: The command "mc :VCEnd" exited with code 1
- Does log4cpp takes care of heap fragmentations issue?
- is log4cpp inter-process safe for writing to the same file?
- Undefined reference to log4cpp (GENIE generator installation error message)
- Log4cpp Naming Collision for 'DEBUG' detected.
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?
Popular Tags
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)
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.