Access WebLogic LogFiles with the RESTful Management Interface

At some expert panel a fortnight ago it was discussed how nice it would be to access the WebLogic logfiles via a simple REST request. Here is how it works:

 

Configuration

Enable the RESTful management interface in WebLogic under DOMAIN / Configuration / General / Advanced. It’s a non-dynamic change, so restart the admin server.

Screen Shot 2015-04-07 at 15.20.50

 

Access Log Files

Once the RESTful management is enabled simply use your preferred REST client. One possibility is to use the browser either by typing the URI directly and submitting a GET request. Yet a REST plugin as shown below might be the more comfortable option:

Screen Shot 2015-04-07 at 15.28.23 Screen Shot 2015-04-07 at 15.28.47

For the URI make sure to use host:port of the admin server.
On the response view simply click on the log file that interests you.

Alternatively you can use the UNIX command-line curl:

$ curl --user weblogic:welcome1  -X GET http://localhost:7001/management/wls/latest/servers/id/AdminServer/logs/id/ServerLog

Which URI?

Use the correct SERVER_NAME, e.g. AdminServer in the URI management/wls/latest/servers/id/SERVER_NAME/logs/id/HTTPAccessLog
and replace HTTPAccessLog with the log file you are interested in, such as DataSourceLogDomainLogServerLog.

 

More?

I explained the benefits of using REST for operations in a previous article which also contains a reference to a 2 minute tech tip recorded by OTN.

Make sure to browse the official Oracle WebLogic documentation here.

 

Latest Review of Middleware and Cloud Computing Book

gifted 3 copies of my Middleware and Cloud Computing book for Christmas.

One of the winners even wrote a review on Amazon.com. He seems to enjoy the book, so good news :-).

Although it was published as early as 2011 (a year before Larry Ellison announced the Oracle public cloud!) it continuous to be a comprehensive resource to understand how public clouds such as Amazon Web Services (AWS) and Rackspace work, what is mandatory for a real cloud and why it is such a long journey for Oracle to get there.

 

Cloud Computing Workshop, Dr. Frank Munz, Oracle ACE Director

Using HTTP instead of T3 for WebLogic Scripting Tool (WLST)

A friend of mine asked why the WLST connection from the Jython based scripting tool is only working with t3. IMHO using t3 for WLST is not a big deal since it is a WebLogic tool talking to WebLogic itself, and t3 was built and optimised for that.

You might want to replace t3 with HTTP anyway, e.g. for one the following reasons:

- for the sake of standards, you want to use as many standard protocols as possible. t3 is WebLogic vendor specific.

- you might have problems with t3 when connecting through firewalls.

 

Easy Solution

Here is the good news. Unknown to many, WLST does work with HTTP if you enable tunneling for the Admin server ( Admin Server / Protocols / General ).

Screen Shot 2015-03-02 at 10.24.50

then it’ possible to use HTTP for WLST:

wls:/offline> connect('weblogic','welcome1','http://localhost:7001')
Connecting to http://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "simon".
Warning: An insecure protocol was used to connect to the 
server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead.

Using a Network Channel

Alternatively if you want to separate the admin traffic but not use SSL (which would be enforced e.g. by using the administration port feature of WebLogic), you could create a network channel under Admin Server / Protocols / Channels for the t3 protocol, e.g. on port 8888 and enable “Tunneling” for that channel. Note that http is already enabled for the channel but this is not enough, you must enable tunneling.

Screen Shot 2015-03-02 at 10.15.29

 

Administration Port

The third and most secure possibility of course is using tunneling in combination with the administration port.

 

Comments:

– You do not need the administration port for using WLST with HTTP.

– It’s not required to change WLST from t3 to HTTP. This posting only shows how it can be done if one of the reasons above apply to you.

– Changing other clients from t3 to IIOP or so, e.g. JMS clients or standalone Java clients using RMI typically has more implications which are not discussed here.

 

More?

If you want to learn more about the basics WebLogic scripting tool I recommend to start with the following web cast.

OUGN Conference 2015 Trip Report

Saturday night I returned from my trip to Oslo where I attended the OUGN2015 conference. Myself, I presented some exciting WebLogic 12.1.3 features doing a rather technical hands-on demo with a few slides only. As usually, I tried to mention the existing show stoppers. Indeed I had no fixed agenda, instead I tried to make best use of the allotted 45 minutes showing as much as possible which worked out well.
Seems like the attendees were most impressed by my demo using the new RESTful API in a combination with URLs typed into the browser, curl, Python and a REST plugin to create and test a JDBC data source.

#OUGN2015 Conference / Frank Munz

(thx to Michel Schildmeijer for this pic!)

Overall it was a fabulous event – not only (but also) because it was hosted on a cruise ship. Since I recently explored the Hadoop eco system and big data myself, I highly enjoyed the keynote given by James Morle ( “map reduce is dead”, “the industry suffers from overly complex systems”). Also I largely agree on what calls the “idiot factor” in IT.

20150312_130359

I attended some strategy and middleware sessions, but I learned most about big data. Good to see that Oracle is not missing the boat here with technologies like Kafka, Spark and Storm but nicely integrates with them.

Also exploring Oslo was lovely! It was my first time there and I checked out some cafes, the harbour area and a few museums, including the Viking Ship museums and the Kon-Tiki museum where you can see the vessel that Heyerdahl used to cross the pacific with his men and a parrot.

20150311_114235

Apart from learning something new, what matters about a conference is who do you meet and who do you chat with. OUGN2015 was well worth the trip!

Winners of the Christmas Cloud Book Raffle

The winners for the yearly Christmas Book raffle were drawn. Three people won a copy of Middleware and Cloud Computing Book:

  • Jean-Nicola M. (drawn for FB retrweet)
  • @HeshamAboElMagd (retweet)
  • @ashish__awasthi (retweet)

 

Enjoy the book guys. It’s on the way already!