Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default logging is very verbose #57

Closed
michielproce opened this issue Nov 17, 2014 · 11 comments
Closed

Default logging is very verbose #57

michielproce opened this issue Nov 17, 2014 · 11 comments

Comments

@michielproce
Copy link

If you're experienced with DCEVM, HotswapAgent is easy to get running.
My only problem with the default is that the logging is a very verbose. I'm having trouble following my own application's logging.

Most of the logging looks like this:

(-1 / -1) (org/hotswap/agent/plugin/jvm/AnonymousClassInfos$AnonymousClassInfoMatcher/org/hotswap/agent/plugin/jvm/AnonymousClassInfos$AnonymousClassInfoMatcher)
{instance class} 
 - klass: {other class}
{instance class} 
 - klass: {other class}

I've tried disabling the logging but it appears my LOGGER=warn in a hotswap-agent.properties in my classpath doesn't seem to be picked up.

(BTW: Thanks for a pretty great alternative to JRebel :))

@edudant
Copy link
Contributor

edudant commented Dec 14, 2014

Hi, can you please describe your setup? This logging is directly from DCEVM and is only related to Hotswap Plugin class redefinition.

Default HotswapAgent logging level is INFO.

Do you use latest DCEVM?

@michielproce
Copy link
Author

I'm using JDK 1.7.0_51 64 bit (host: Win7), DCEVM 24.51-b03-dcvmfull-3 (latest on dcevm.github.io).
I'm running an webapplication on Tomcat 7.0.50.

I've noticed that the verbose logging does not happen at other webapps, so there might be something application specific going on. If I run the application with DCEVM but without HotswapAgent the logging stops.
How can I suppress these messages?

If you need additional information, let me know.

@skybber
Copy link
Contributor

skybber commented Aug 30, 2015

Logging Source of this stuff is definitively DCEVM or OpenJDK respectively. I did some private patch, because I hate this mess.

@skybber skybber closed this as completed Aug 30, 2015
@victorpablosceruelo
Copy link

Do you have the patch somewhere?
Could you tell us how to patch?
Thanks in advance.

@skybber
Copy link
Contributor

skybber commented Sep 24, 2015

Comment following lines (this is for v7u85):

diff --git a/src/share/vm/classfile/systemDictionary.cpp b/src/share/vm/classfile/systemDictionary.cpp
index 39ec219..1321603 100644
--- a/src/share/vm/classfile/systemDictionary.cpp
+++ b/src/share/vm/classfile/systemDictionary.cpp
@@ -2032,7 +2032,7 @@ void SystemDictionary::check_constraints(int d_index, unsigned int d_hash,
       assert(check->klass_part()->oop_is_instance(), "noninstance in systemdictionary");
       if ((defining == true) && ((k() != check) && k->old_version() != check)) {
         ResourceMark rm(Thread::current());
-        tty->print_cr("(%d / %d) (%s/%s)", k->revision_number(), check->klass_part()->revision_number(), k->name()->as_C_string(), check->klass_part()->name()->as_C_string());
+        // tty->print_cr("(%d / %d) (%s/%s)", k->revision_number(), check->klass_part()->revision_number(), k->name()->as_C_string(), check->klass_part()->name()->as_C_string());
         k()->print();
         check->print();
         linkage_error = "loader (instance of  %s): attempted  duplicate class "
diff --git a/src/share/vm/oops/klass.cpp b/src/share/vm/oops/klass.cpp
index 19a9f5b..8361662 100644
--- a/src/share/vm/oops/klass.cpp
+++ b/src/share/vm/oops/klass.cpp
@@ -601,7 +601,7 @@ jint Klass::jvmti_class_status() const {
 void Klass::oop_print_on(oop obj, outputStream* st) {
   ResourceMark rm;
   // print title
-  st->print_cr("%s ", internal_name());
+  // st->print_cr("%s ", internal_name());
   obj->print_address_on(st);

   if (WizardMode) {
@@ -610,15 +610,15 @@ void Klass::oop_print_on(oop obj, outputStream* st) {
   }

   // print class
-  st->print(" - klass: ");
+  // st->print(" - klass: ");
   obj->klass()->print_value_on(st);
-  st->cr();
+  //st->cr();
 }

 void Klass::oop_print_value_on(oop obj, outputStream* st) {
   // print title
   ResourceMark rm;              // Cannot print in debug mode without this
-  st->print("%s", internal_name());
+  // st->print("%s", internal_name());
   obj->print_address_on(st);
 }

@victorpablosceruelo
Copy link

Thank you very much. It works perfectly for 7u79 too.

I've asked DCEVM developers to apply your patch or something similar when in production mode
dcevm/dcevm#86

Hope it helps other people.

@skybber
Copy link
Contributor

skybber commented Sep 25, 2015

My solution is hack. I didn't study the purpose, why the messages are printed directly to stdout. There should be another solution how to avoid this.

@PrabakaranSK
Copy link

@skybber - Would you be kind enough to patch the DCE VM source all by yourself, as it seems no one is assigned to fix this issue on DCEVM side?

@cchilds
Copy link

cchilds commented Dec 7, 2015

I have spent days trying to get dcevm to compile with no success. If someone here has or could get a build of java 7u79 full, with these logging fixes applied, I would love you forever.

@victorpablosceruelo
Copy link

cchilds, if you use debian/ubuntu you can use the following url as repository:
http://babel.ls.fi.upm.es/~vpablos/others/packages/debian/

It is 7u79 without patching, but it is the only version I have successfully patched.
The other ones gave me headaches ... :-(

If not, you can always download the package and extract the files from it.
By the way, eclipse Mars does not work with DCEVM.

@cchilds
Copy link

cchilds commented Dec 7, 2015

Thanks @vpablos, but unfortunately, I'm using Windows. Thanks anyway.

What issues are you having with Mars and DCEVM? I have used it with Mars quite a bit with no problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants