Windows – What are “System32\config\systemprofile\javaXX.log” files in Windows Server

javawindowswindows-server-2008-r2

I have Windows server whose c:\ drive is almost full. Only 2 GB is free instead of 60 GB, on which size of folder C:\Windows\System32\config\systemprofile is 24.1 GB. Folder is showing me two kind of files, javaxx.log and javaxx.log.lck. where xx is two digit number.

My questions are:

  • What data is contained by this folder?
  • Can we delete data from the path?

Best Answer

The %systemroot%\System32\config\systemprofile is the %USERPROFILE% equivalent for the system user nt authority\system: e.g. if you run command line as the system user, cd %AppData% will change to directory C:\Windows\System32\config\systemprofile\AppData\Roaming.

The javaXX.log files are probably generated by some Java program using FileHandler (from java.util.logging) with default settings or default log rotation pattern. Shortened, relevant parts:

By default each FileHandler is initialized using the following LogManager configuration properties where <handler-name> refers to the fully-qualified class name of the handler. If properties are not defined (or have invalid values) then the specified default values are used.

  • <handler-name>.pattern specifies a pattern for generating the output file name. See below for details. (Defaults to %h/java%u.log).

A pattern consists of a string that includes the following special components that will be replaced at runtime:

  • %h the value of the user.home system property
  • %g the generation number to distinguish rotated logs
  • %u a unique number to resolve conflicts

Generation numbers follow the sequence 0, 1, 2, etc.

The user.home would be %USERPROFILE% in Windows, so this would results in the naming pattern of your .log files. The .lck files are just lock files to prevent simultaneous usage of these files.

We can't say how important these log files are for you. You could create an automated script that removes the oldest log files, or even better implement this to the log rotation in the Java program.